From: Co on 11 Aug 2010 02:42 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
From: Jon Lewis on 11 Aug 2010 04:23 Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On Activate event. Jon "Co" <vonclausowitz(a)gmail.com> wrote in message news:ae7efe9d-6f65-4427-b527-b372fdb05035(a)y11g2000yqm.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
From: Co on 11 Aug 2010 04:58 On 11 aug, 11:23, "Jon Lewis" <jon.le...(a)cutthespambtinternet.com> wrote: > Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On Activate > event. > > Jon > > "Co" <vonclausow...(a)gmail.com> wrote in message > > news:ae7efe9d-6f65-4427-b527-b372fdb05035(a)y11g2000yqm.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
From: Jon Lewis on 11 Aug 2010 05:36 "Co" <vonclausowitz(a)gmail.com> wrote in message news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2(a)e15g2000yqo.googlegroups.com... On 11 aug, 11:23, "Jon Lewis" <jon.le...(a)cutthespambtinternet.com> wrote: > Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On > Activate > event. > > Jon > > "Co" <vonclausow...(a)gmail.com> wrote in message > > news:ae7efe9d-6f65-4427-b527-b372fdb05035(a)y11g2000yqm.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
From: Co on 11 Aug 2010 05:43 On 11 aug, 12:36, "Jon Lewis" <jon.le...(a)cutthespambtinternet.com> wrote: > "Co" <vonclausow...(a)gmail.com> wrote in message > > news:7224e501-64a9-4eaa-9d4d-8e4c590bbdc2(a)e15g2000yqo.googlegroups.com... > On 11 aug, 11:23, "Jon Lewis" <jon.le...(a)cutthespambtinternet.com> > wrote: > > > > > > > Try DoCmd.RunCommand acCmdSelectRecord in the continuous form's On > > Activate > > event. > > > Jon > > > "Co" <vonclausow...(a)gmail.com> wrote in message > > >news:ae7efe9d-6f65-4427-b527-b372fdb05035(a)y11g2000yqm.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
|
Next
|
Last
Pages: 1 2 3 Prev: Many-to-many question Next: unable to put an option group on a subform without crash |