OpenArgs HELP ME PLEASE!

Neilster

Registered User.
Local time
Today, 08:07
Joined
Jan 19, 2014
Messages
218
I have a form with a button that opens a password form, enter the password and then that opens another form.

What I need is after the password has been entered and then another form opens I need it to relate to the first form.

I know this works when you just have a button to open a form which relate together.

Docmd.OpenForm, "Form", , , "TxtBox = '" & Me.txtBox & "'"

But I need it to skip over the password form and then open the second for so that its related to the first from.

Please help!! :banghead::banghead:
 
There is no need for the "TxtBOX = " part In your openArgs.

Use the form's OnOpen event to decide what to do when the form is opened.
 
Sorry I really don't understand how the code should be written. Like this?

DoCmd.OpenForm "FrmBankDetails", , , & Me.StudentName & "'"

I'm new to OpenArgs
 
With "openargs" you are passing a string to the form being opened. What you would have is:

Code:
DoCmd.OpenForm "FrmBankDetails", , , Me.StudentName

OpenArgs
 
Yeh tried what you have suggested an I get an syntax error (Missing operator)

)-:
 
Just prior to executing "DoCmd", run "debug.print Me.StudentName" to verify that it has a value.
Is "StudentName", the name of an actual control in your form? You need to use the name of the control.
 
:) Few more comas should solve the issue
DoCmd.OpenForm "FrmBankDetails", , , , , , Me.StudentName
 
:) Few more comas should solve the issue
DoCmd.OpenForm "FrmBankDetails", , , , , , Me.StudentName

This should be OK
Just look in the help for DoCmd.OpenForm to make sure for the correct number of commas
 
Hi guys

Have done all of the above, opens the form put always to the first record.

The name of the text box in the admin form is StudentName and the name of the text box in bankdetails is StudentName, therefore I need those to relate after entering a password in a password form????
 
Do you want the form only to show the record equal to StudentName?
If yes try the below code, (then the title for this thread is wrong, it has nothing to do with OpenArgs"):
Code:
DoCmd.OpenForm "FrmBankDetails", , , "StudentName= '" & Me.StudentName & "'"
 
I have tried all of the above advice and nothing seems to be working, do I put

DoCmd.OpenForm "FrmBankDetails", , , "StudentName= '" & Me.StudentName & "'"

On the open form event on bank details form? if so I have tried everything and am at a loss )-:
 
What JHB suggested is using the form's filter.

If you use the openArgs use it to create the form's query and requry.
 

Users who are viewing this thread

Back
Top Bottom