A
Afrosheen via AccessMonster.com
Good morning. I have a form with a subfom on it. I use the subform as a
search box. When I enter the last name of the person the subform works the
way it should and looks up the record and displays it. What I'd like to do is
when I close the subform I would like the main form goto that record from the
information on the subform when I close the subform. I'm trying to use the
GoToRecord clause. Here is the code.
20 Me.Parent!cmdSave.SetFocus
30 Me.Parent!SubFrmFind.Visible = False
DoCmd.GoToRecord ([StaffId] = Text12)
The staffid is a text field. The text12 is just a text box that has the
staffid in it. The problem is that all it does is go to the next record not
the record I need.
When I tried using the DoCmd.FindFirst ([StaffId] = Text12) I got errors.
Thanks for your help and reply.
search box. When I enter the last name of the person the subform works the
way it should and looks up the record and displays it. What I'd like to do is
when I close the subform I would like the main form goto that record from the
information on the subform when I close the subform. I'm trying to use the
GoToRecord clause. Here is the code.
20 Me.Parent!cmdSave.SetFocus
30 Me.Parent!SubFrmFind.Visible = False
DoCmd.GoToRecord ([StaffId] = Text12)
The staffid is a text field. The text12 is just a text box that has the
staffid in it. The problem is that all it does is go to the next record not
the record I need.
When I tried using the DoCmd.FindFirst ([StaffId] = Text12) I got errors.
Thanks for your help and reply.