Hi John, thanks for your response. Sorry, "record number" is possibly a bad
term - better just to say "record"
To expand on my problem, I have a form and a subform. The subform is for
"Site" information (Site_Id, site_name, latitude, longitude, elevation, etc).
In this subform, the user can click a button to open up another form to
display a list of sites (in datasheet view) that have already been entered.
If the user wishes to use one of these existing sites, he/she can select a
record, I have an event procedure set up so that the "Site_ID" (my primary
key) of the selected record is written back to my subform. Every works fine
to this point.
My problem is, I can't get my subform to automatically goto this record on
my subform and display all the corresponding site information after the
record is selected and written to my sub form - I can only manually navigate
to it at this stage. I thought I could use the "GoToRecord" method - e.g.
DoCmd.GoToRecord acActiveDataObject, , acGoTo, varRecordNumber
where "varRecordNumber" corresponds to the record (number) of the value of
my "Site_ID" field. This is why I was trying to create a variable to return a
record (number). Is this not possible? Is there a better way?
Cheers, Damian