T
trekgoes2malaysia
I'm trying to highlight a date in a list box based on a date in
another form . I want the user to click a control on one form that
opens another form which contains a long listbox of dates. Because the
list of dates is very long, I am trying to save the user time by
avoiding the need to scroll down to find the date they want each time
they open the form. Rather, the procedure should automatically scroll
through the listbox to the same date (id) that is on the parent
form. How can I do this in VBA?
Below is my attempt that didn't work.
********************************************************************************************
Private Sub PickNewDate_Click()
On Error GoTo Err_PickNewDate_Click
Dim stFormName As String
stFormName = "frmdateselect"
DoCmd.OpenForm stFormName
Forms!frmdateselect!ListPickDate.DefaultValue = Forms!datelog!
dateid.Value
Exit_PickNewDate_Click:
Exit Sub
Err_PickNewDate_Click:
MsgBox Err.Description
Resume Exit_PickNewDate_Click
End Sub
********************************************************************************************
another form . I want the user to click a control on one form that
opens another form which contains a long listbox of dates. Because the
list of dates is very long, I am trying to save the user time by
avoiding the need to scroll down to find the date they want each time
they open the form. Rather, the procedure should automatically scroll
through the listbox to the same date (id) that is on the parent
form. How can I do this in VBA?
Below is my attempt that didn't work.
********************************************************************************************
Private Sub PickNewDate_Click()
On Error GoTo Err_PickNewDate_Click
Dim stFormName As String
stFormName = "frmdateselect"
DoCmd.OpenForm stFormName
Forms!frmdateselect!ListPickDate.DefaultValue = Forms!datelog!
dateid.Value
Exit_PickNewDate_Click:
Exit Sub
Err_PickNewDate_Click:
MsgBox Err.Description
Resume Exit_PickNewDate_Click
End Sub
********************************************************************************************