Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenArgs 1

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
I have a database that was built by another person and it has the following bit of code in it:

Private Sub Form_Load()

If Me.OpenArgs = "+" Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If

End Sub

I am not sure what the Me.OpenArgs = "+" means. I would greatly appreciate an explaination that is easy to understand.

Thanks!
Lena

Lena
Using Access 2003
 


Lena,

You have a control in you form named OpenArgs, maybe a Textbox or Combobox, that contains a VALUE of + or not.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
It is possible to open a form with an OpenArg:

DoCmd.OpenForm "frmForm",,,,,,"+"

OpenArgs can be just about anything and can be retrieved using the OpenArgs property of the form (Me.OpenArgs).

 
Have a look at the 7th argument of the DoCmd.OpenForm method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Skip - no control named OpenArgs.

Remou and PH - I found another instance of the OpenArgs used in the database. I guess I don't understand how the OpenArgs is set to "+" in the first place.

I tried doing a search for + and found alot of them, but they were being used to concatenate fields into strings.

Maybe I am not looking for the right thing.

Thanks in advance for your help!
Lena

Lena
Using Access 2003
 
Look at my post again:

DoCmd.OpenForm "frmForm",,,,,,"+"
 
Remou,

Yes, I see that now. The other line I was seeing was the one passing the "+". Thank you for pointing that out.

It ended up being where this form was being opened from another form. Not sure why it wasn't just opened as a new record from the other form, but at least I have learned a new way to do things :)

Thanks again!
Lena

Lena
Using Access 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top