I have an Access 2000 application where records ALL records are added, edited and displayed in the mainform with a summary list of all data for a specific date shown in the subform.
Records on the mainform are ordered buy date and all recordes for the displayed date are shown on the subform.
When the user clicks on a name in the subform I want the record displayed for editing on the mainform. This works great unless there is a record in the system with the same name for an advanced date. (for example reservations for 10/5/02 are displayed and they click on the name but for that particular name there is an advanced reservation in the system for 10/19/02 and that's the record that is displayed for editing)
How do I get the search to find the record containing the (name AND the reservation date) displayed on the subform. The code I'm using is below.
Private Sub xName_Click()
Dim mResvDate As Date
Dim mName As String
mResvDate = [Reservation]
DoCmd.GoToControl ("ResSubform"
mName = [xName]
DoCmd.GoToControl ("cmbName"
DoCmd.FindRecord mName, acAnywhere, , acSearchAll, , acAll, True
End Sub
Thanks in advance,
Steve
Records on the mainform are ordered buy date and all recordes for the displayed date are shown on the subform.
When the user clicks on a name in the subform I want the record displayed for editing on the mainform. This works great unless there is a record in the system with the same name for an advanced date. (for example reservations for 10/5/02 are displayed and they click on the name but for that particular name there is an advanced reservation in the system for 10/19/02 and that's the record that is displayed for editing)
How do I get the search to find the record containing the (name AND the reservation date) displayed on the subform. The code I'm using is below.
Private Sub xName_Click()
Dim mResvDate As Date
Dim mName As String
mResvDate = [Reservation]
DoCmd.GoToControl ("ResSubform"
mName = [xName]
DoCmd.GoToControl ("cmbName"
DoCmd.FindRecord mName, acAnywhere, , acSearchAll, , acAll, True
End Sub
Thanks in advance,
Steve