S
Sharkbyte
I am attempting to jump to a record, on a form open, using criteria supplied
by the previous form. I found an earlier discussion, on this topic, but was
unsuccessful in making the code work. Hopefully someone can help me out.
Here is the code I am trying to run:
DoCmd.OpenForm "frmsinglewrlookup"
DoCmd.GoToControl [Forms]![frmsinglewrlookup]![WORK_REQUEST_NO]
DoCmd.FindRecord Me.WORK_REQUEST_NO, acEntire, , acSearchAll, , acCurrent,
True
I have tried putting the last 2 lines on the Open event, of the 2nd form,
with no luck. It kept looking for a control named the same as the value of
[Forms]![frmsinglewrlookup]![WORK_REQUEST_NO].
However, setting it after the DoCMD.FormOpen returns an Error 2046 - "The
Command or Action 'GoToControl' isn't available now."
If I comment the line, I get the same error, for 'FindRecord'.
Any suggestions? I think it is partly an event timing issue, but I think
there may be a second problem in that it isn't identifying the control, but
rather the value of that control.
Thanks in advance.
Sharkbyte
by the previous form. I found an earlier discussion, on this topic, but was
unsuccessful in making the code work. Hopefully someone can help me out.
Here is the code I am trying to run:
DoCmd.OpenForm "frmsinglewrlookup"
DoCmd.GoToControl [Forms]![frmsinglewrlookup]![WORK_REQUEST_NO]
DoCmd.FindRecord Me.WORK_REQUEST_NO, acEntire, , acSearchAll, , acCurrent,
True
I have tried putting the last 2 lines on the Open event, of the 2nd form,
with no luck. It kept looking for a control named the same as the value of
[Forms]![frmsinglewrlookup]![WORK_REQUEST_NO].
However, setting it after the DoCMD.FormOpen returns an Error 2046 - "The
Command or Action 'GoToControl' isn't available now."
If I comment the line, I get the same error, for 'FindRecord'.
Any suggestions? I think it is partly an event timing issue, but I think
there may be a second problem in that it isn't identifying the control, but
rather the value of that control.
Thanks in advance.
Sharkbyte