J
Jack G
I have a Main Form with a subform (called "Subform") in it. The subform's
Source Object gets swapped depending on what button is clicked on the Main
Form.
I also have an unbound text box on the Main Form called [GoTo] where I want
to enter a "project number" and then have the subform go to that record. I
have the following for the AfterUpdate event of the [GoTo]textbox:
Dim stCurrentProject As String
stCurrentProject = [GoTo]
Me!Subform!ctlProjectNumber.SetFocus
DoCmd.FindRecord stCurrentProject, acEntire, False, , False, acCurrent, True
But the last line doesn't work, giving me an error that says, "...failed
because of an error in a FindRecord action argument. The code used to work
when the [GoTo] textbox was in the subform itself, but not now that it's out
in the main form.
Can anyone help me get this right?
Thanks,
Jack
Source Object gets swapped depending on what button is clicked on the Main
Form.
I also have an unbound text box on the Main Form called [GoTo] where I want
to enter a "project number" and then have the subform go to that record. I
have the following for the AfterUpdate event of the [GoTo]textbox:
Dim stCurrentProject As String
stCurrentProject = [GoTo]
Me!Subform!ctlProjectNumber.SetFocus
DoCmd.FindRecord stCurrentProject, acEntire, False, , False, acCurrent, True
But the last line doesn't work, giving me an error that says, "...failed
because of an error in a FindRecord action argument. The code used to work
when the [GoTo] textbox was in the subform itself, but not now that it's out
in the main form.
Can anyone help me get this right?
Thanks,
Jack