GoToNew

bnw

Registered User.
Local time
Yesterday, 22:39
Joined
Sep 19, 2006
Messages
26
DoCmd.OpenForm "frmEvents" , , , , , acDialog, "GoToNew"

What do "GoToNew" means? :(
 
It is the OpenArgs argument string. It does nothing on its own. The next form needs to look at it and decide what to do.
 
It is in the last argument of OpenForm so it should be the [OpenArgs]. OpenArgs is a way to pass data from a form to another form when opening it.

If you check the form it opens, in the OpenForm event there probably is an If or Case statement that performs logic on "GoToNew".

-dK
 
Okay. Thank you both for the explanation.
 
It is in the last argument of OpenForm so it should be the [OpenArgs]. OpenArgs is a way to pass data from a form to another form when opening it.

If you check the form it opens, in the OpenForm event there probably is an If or Case statement that performs logic on "GoToNew".

-dK

Hello,

I had to read your explanation over again. Are you indicating that after the
"frmEvents" is open, the "GoToNew" string means that a new form is open not the frmEvents? I'm a little confuse. Sorry
 
No. Whoever coded it could have used "MoogliBoogli". They probably used "GoToNew" to help them keep it sorted in their head while coding.

In the form, you can evaluate OpenArgs. For instance, I am in Form A and have it automatically open Form B. However, for Form B, the application needs to know if the form was opened from Form A or from Form C to do certain things. So, the argument I use in Form A is "OpenedFromFormA" and from C I use "OpenedFormFormC".

In the On Open event of Form B I might have ...

Code:
If OpenArgs = "OpenedFromFormA" Then
     'do whatever because it opened from Form A
ElseIf OpenArgs = "OpenedFormFormC" Then
     'do something else
ElseIf OpenArgs = "GoToNew" Then
     'form was opened from a command button called new record so make a new record for this form
ElseIf OpenArgs = "MoogliBoogli" Then
     'do some moogliboogli stuff
End If

Basically, it is just a way to pass data to another form - or in this case, a message so the application can do the right thing based on what was going on when the form was opened. It is confusing you because the message being passed is "GoToNew" which sounds like some sort of programatic stuff. You might have the same confusion if the message passed was "DestroyHarddrive". It doesn't do anything, ir just lets the new form know something about why it was opened so it can evaluate and do the proper thing based on the logic of the programmer.

Note: You can evaluate OpenArgs anywhere in the form, not just the On Open event.

-dK
 
Last edited:

Users who are viewing this thread

Back
Top Bottom