dbTalk Databases Forums  

highlight current record in continious form

comp.databases.ms-access comp.databases.ms-access


Discuss highlight current record in continious form in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Co
 
Posts: n/a

Default highlight current record in continious form - 08-11-2010 , 01:42 AM






Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands

Reply With Quote
  #2  
Old   
Jon Lewis
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 03:23 AM






Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On Activate
event.

Jon


"Co" <vonclausowitz (AT) gmail (DOT) com> wrote

Quote:
Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands

Reply With Quote
  #3  
Old   
Co
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 03:58 AM



On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com...



Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
* *lngTop = .SelTop
* *.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
* *.SelTop = lngTop
* *If Not .RecordsetClone.NoMatch Then
* * * *.Bookmark = .RecordsetClone.Bookmark
* *End If
* *.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

Reply With Quote
  #4  
Old   
Jon Lewis
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 04:36 AM



"Co" <vonclausowitz (AT) gmail (DOT) com> wrote

On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On
Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com...



Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I've just tested this in the Current Event on a Datasheet and it seems to
work fine. How are you scrolling through the records? I'm pressing the
Down Arrow and am getting each row highlighted as if a was pressing the
Record Selector. Maybe you have other code executing affecting this?

Jon

Reply With Quote
  #5  
Old   
Co
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 04:43 AM



On 11 aug, 12:36, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2 (AT) e15g2000yqo (DOT) googlegroups.com...
On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:





Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On
Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com....

Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I've just tested this in the Current Event on a Datasheet and it seems to
work fine. *How are you scrolling through the records? *I'm pressing the
Down Arrow and am getting each row highlighted as if a was pressing the
Record Selector. *Maybe you have other code executing affecting this?

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
I have a conditional formatting on a deadline field it checks the
date.
Maybe that's causing it highlight to dissapear.

Marco

Reply With Quote
  #6  
Old   
Jon Lewis
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 05:08 AM



"Co" <vonclausowitz (AT) gmail (DOT) com> wrote

On 11 aug, 12:36, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2 (AT) e15g2000yqo (DOT) googlegroups.com...
On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:





Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On
Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com...

Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I've just tested this in the Current Event on a Datasheet and it seems to
work fine. How are you scrolling through the records? I'm pressing the
Down Arrow and am getting each row highlighted as if a was pressing the
Record Selector. Maybe you have other code executing affecting this?

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
I have a conditional formatting on a deadline field it checks the
date.
Maybe that's causing it highlight to dissapear.

Marco

Maybe - temporarily remove it and check.

Jon

Reply With Quote
  #7  
Old   
Co
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 05:22 AM



On 11 aug, 13:08, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:8aa6c107-53e6-470b-9deb-562166f79eeb (AT) y11g2000yqm (DOT) googlegroups.com...
On 11 aug, 12:36, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:





"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2 (AT) e15g2000yqo (DOT) googlegroups.com...
On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:

Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On
Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com...

Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the recordselector
shows which record
it is but I would like to have the whole record highlighted (like when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I've just tested this in the Current Event on a Datasheet and it seems to
work fine. How are you scrolling through the records? I'm pressing the
Down Arrow and am getting each row highlighted as if a was pressing the
Record Selector. Maybe you have other code executing affecting this?

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

I have a conditional formatting on a deadline field it checks the
date.
Maybe that's causing it highlight to dissapear.

Marco

Maybe - temporarily remove it and check.

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
That doesn't change anything.

MArco

Reply With Quote
  #8  
Old   
Jon Lewis
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 06:29 AM



"Co" <vonclausowitz (AT) gmail (DOT) com> wrote

Quote:
On 11 aug, 13:08, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:
"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:8aa6c107-53e6-470b-9deb-562166f79eeb (AT) y11g2000yqm (DOT) googlegroups.com...
On 11 aug, 12:36, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:





"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2 (AT) e15g2000yqo (DOT) googlegroups.com...
On 11 aug, 11:23, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:

Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On
Activate
event.

Jon

"Co" <vonclausow... (AT) gmail (DOT) com> wrote in message

news:ae7efe9d-6f65-4427-b527-b372fdb05035 (AT) y11g2000yqm (DOT) googlegroups.com...

Hi All,

I know there are so many questions on this issue but mine is just a
little different.
What I am trying to establish is the following:
The user clicks Alt-Q which opens a form with a listbox with years
on
it.
When he chooses a year the form closes and in my continious form it
jumps to the
first record of that year. Now the little arrow in the
recordselector
shows which record
it is but I would like to have the whole record highlighted (like
when
you click with the
mouse on the recordselector).
How can I simulate the mouse click or highlight the record for that
matter?

My code:

Private Sub Keuzelijst1_AfterUpdate()

Dim int1 As Integer
Dim str1 As String
Dim lngTop As Long

int1 = 4
str1 = "Left([BriefNr]," & int1 & ")"

varJaar = Keuzelijst1.value

With Forms!FrmTabelTotaal!subFrmTabelTotaal.Form
lngTop = .SelTop
.RecordsetClone.FindLast (str1 & " = '" & varJaar & "'")
.SelTop = lngTop
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
End If
.Form_Click

End With
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub

Regards
Marco
The Netherlands- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I've just tested this in the Current Event on a Datasheet and it seems
to
work fine. How are you scrolling through the records? I'm pressing the
Down Arrow and am getting each row highlighted as if a was pressing the
Record Selector. Maybe you have other code executing affecting this?

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

I have a conditional formatting on a deadline field it checks the
date.
Maybe that's causing it highlight to dissapear.

Marco

Maybe - temporarily remove it and check.

Jon- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

That doesn't change anything.

MArco
I would suggest that you create a new Datasheet form based on an existing
table and put DoCmd.RunCommand acCmdSelectRecord in its Current Event just
to prove that it works in your version/SP of Access, then examine the
differences in your real scenario to find out what the problem is.

Jon

Reply With Quote
  #9  
Old   
Salad
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 10:39 AM



Co wrote:
Quote:
Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco
I created a Datasheet form. In the header, I dropped in a text box and
named it NewID. When opened, the textbox does not appear in the header.

In the OnCurrent event I entered
Me.NewID = Me.ID 'ID is the table id name

Then I set conditional formatting on the ID field (it's not hidden).
FieldValueIs EqualTo [NewID] and set some color.

Opened/ran. Does the trick. But doesn't maintain the color.

So maybe when you Alt-Q, set NewID to the value if when first year
record is found. You could use a DblClick event to set NewID as well
while in the form.

Reply With Quote
  #10  
Old   
Co
 
Posts: n/a

Default Re: highlight current record in continious form - 08-11-2010 , 01:33 PM



On 11 aug, 18:39, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Co wrote:
Jon thanks for the response.

There are two things. The form I use is not a continious one its
actually Datasheet, my mistake.
I put the code in the Current event because the On Active didn't work.

It does highlight the record now but when I try to scroll through the
records the highlight dissapears.

Marco

I created a Datasheet form. *In the header, I dropped in a text box and
named it NewID. *When opened, the textbox does not appear in the header..

In the OnCurrent event I entered
* * * * Me.NewID = Me.ID *'ID is the table id name

Then I set conditional formatting on the ID field (it's not hidden).
FieldValueIs EqualTo [NewID] and set some color.

Opened/ran. *Does the trick. *But doesn't maintain the color.

So maybe when you Alt-Q, set NewID to the value if when first year
record is found. *You could use a DblClick event to set NewID as well
while in the form.
I am very curious how you do this because when I place the textbox in
the header
and call it NewID the form doesn't recognize it.

Marco

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.