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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gotorecord

Status
Not open for further replies.

8441

Technical User
May 9, 2001
54
GB
I am trying to use the docmd.gotorecord command to display a certain record in a subform by selecting a record on a total different form.

Here is what happens. A user enters a candidate and after entering the surname a form appears listing any matches on the system. If the candidate is there then the user clicks on their reference number and the original Course Booking form should display with the candidate subform display all that candidates details.

The problem is getting the subform to display the chosen candidate. When I use

DoCmd.GoToRecord acDataForm, "Candidate Subform", acGoTo, Candidate_Number

Candidate Subform isn't Open. The Candidate_Number above stores the click candidate reference.

Can anyone help??

Craig
 
goto is looking for the record number. So if your dataset is returning 30 records and this is the eleventh record. I think you are using the index. the problem is you can't be sure where the record is in the set.
it think you want to look at the openform method

DoCmd.openform "Candidate Subform",, "Candidate_Number = " & me.candidate_number

if that dont do it then I suggest you look at the recordsource property or bookmark or even perhaps a filter
good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top