How to run Form_Current() from macro? or module?

T

Tec92407

I have the following function in a module named Module1

Public Function CheckCommandLine()
Dim strRecNo As String
Dim intRecNo As Integer

strRecNo = Command
MsgBox ("You typed " & strRecNo)
intRecNo = Val(strRecNo)
'Couldn't get this to work
'DoCmd.OpenForm "PRRequisition", acNormal, , "PRREQNo = '50000'"
'The Following Works but I need it to run Form_current
DoCmd.OpenForm "PRRequisition", acNormal
DoCmd.GoToRecord acDataForm, "PRRequisition", acGoTo, intRecNo

End Function

I run this function using the RunCode command in a macro. The macro is run
from the command line and opens the form and displays a specific record. It
displays the correct record but setting that are done by the Form_current
procedure are not set unless I click the next or previous buttons.
I need to run the Form_Current procedure so that t he current record is
displayed properly.

can anyone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top