Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for record in mainform from a subform

Status
Not open for further replies.

raddster

Programmer
Apr 5, 2001
15
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top