Darrenc
Registered User.
- Local time
- Today, 12:43
- Joined
- Apr 30, 2004
- Messages
- 62
Can anyone here that can give me a quick pointer.
I've got a ListBox in my main form, the recordsorce for the ListBox is a query.
The query gets some dates that are stored on my subform table.
The ListBox updates itself when switching records on the main form.
All the above is working fine.
The problem i have is a want a click event on my list box to go directly to the corresponding record on the subform.
I have this bit of code that i thought could do the job, i've tried every variation i can think of to get this to work....each time i get the error message 'You can't go to the specified record'
I've tried changing the column count to 1 when gets the Unique Number for the subform, i've made sure the focus is on the right object, it looks like it should work, it just doesn't!!!
Can anyone help...i haven't got much hair left....
Thanks.
I've got a ListBox in my main form, the recordsorce for the ListBox is a query.
The query gets some dates that are stored on my subform table.
The ListBox updates itself when switching records on the main form.
All the above is working fine.
The problem i have is a want a click event on my list box to go directly to the corresponding record on the subform.
I have this bit of code that i thought could do the job, i've tried every variation i can think of to get this to work....each time i get the error message 'You can't go to the specified record'
Code:
Private Sub List81_Click()
Dim recToFind As Date
recToFind = Me.List81.Column(0)
Me.frmConsultationNotes.SetFocus
DoCmd.GoToRecord acActiveDataObject, , acGoTo, recToFind
End Sub
I've tried changing the column count to 1 when gets the Unique Number for the subform, i've made sure the focus is on the right object, it looks like it should work, it just doesn't!!!
Can anyone help...i haven't got much hair left....
Thanks.