J
JamesJ
Hi. Me again.
I'm attempting to open a form (frmRemindersEdit) to a specific record using
the
On Dbl Click of a listbox on two separate forms.(/lstWeeklyAppts and
frmReminders/lstReminders)
Each form and each listbox
This is the code I'm using on the On Dbl Click of
the listboxes:
Private Sub lstReminders_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmRemindersEdit", OpenArgs:=Me!ReminderID
End Sub
Code On Open of frmRemindersEdit:
Private Sub Form_Open(Cancel As Integer)
Dim rs As DAO.Recordset
If Not IsNull(Me.OpenArgs) Then
Set rs = Me.RecordsetClone
rs.FindFirst "[ReminderID]=" & Me.OpenArgs
If rs.NoMatch Then
Else
Me.Bookmark = rs.Bookmark
End If
End If
Me!Reminder.SetFocus
Me!Reminder.SelStart = 0
End Sub
When I dblclick on frmReminders/lstReminders frmRemindersEdit
opens to the matching ReminderID but when I dblclick
frmHome/lstWeeklyAppts frmRemindersEdit Opens to the first
record in the recordset. Its appears to be ignoring the ID field.
Any reason why lstWeeklyAppts dbleclick isn't working?
All 3 forms have the ID field included in their RecordSource
and all listboxes have the ID field included in their RowSource.
Thanks,
James
I'm attempting to open a form (frmRemindersEdit) to a specific record using
the
On Dbl Click of a listbox on two separate forms.(/lstWeeklyAppts and
frmReminders/lstReminders)
Each form and each listbox
This is the code I'm using on the On Dbl Click of
the listboxes:
Private Sub lstReminders_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmRemindersEdit", OpenArgs:=Me!ReminderID
End Sub
Code On Open of frmRemindersEdit:
Private Sub Form_Open(Cancel As Integer)
Dim rs As DAO.Recordset
If Not IsNull(Me.OpenArgs) Then
Set rs = Me.RecordsetClone
rs.FindFirst "[ReminderID]=" & Me.OpenArgs
If rs.NoMatch Then
Else
Me.Bookmark = rs.Bookmark
End If
End If
Me!Reminder.SetFocus
Me!Reminder.SelStart = 0
End Sub
When I dblclick on frmReminders/lstReminders frmRemindersEdit
opens to the matching ReminderID but when I dblclick
frmHome/lstWeeklyAppts frmRemindersEdit Opens to the first
record in the recordset. Its appears to be ignoring the ID field.
Any reason why lstWeeklyAppts dbleclick isn't working?
All 3 forms have the ID field included in their RecordSource
and all listboxes have the ID field included in their RowSource.
Thanks,
James