Marc wrote:
I have a dialog box to find a specific record in a form by Name Can
anyone tell me how to link it so that when i move out of the dialog
box, it pulls up that persons specific record. Mine keeps popping up
as the 1st record of the form and i can't seem to figure out how to
make it go to the selected specific form.
I'm not sure how you are doing this. Are you on the NameForm and press
a button to call DialogForm, and upon close get the first record in
NameForm?
There's multiple ways of doing what you want to do. I'll assume the
NameForm is open. In your DialogForm, when Select/Find is pressed (i'll
assume it's found) you could do something like this in the Click event
for Select.
Dim rst As Recordset
set rst = Forms!NameForm.Form.Recordsetclone
'it'd be best to search on the key field instead of the name.
'if the key is numeric, remove the single quotes and change the
'field/form names as necessary.
rst.findfirst "NameField = '" & Me.NameField & "'"
If not rst.NoMatch then Forms!FormName.Form.Bookmark = rst.Bookmark
rst.close
set rst = Nothing