Open up a form which link to another form

richardplr

Registered User.
Local time
Today, 23:39
Joined
Jun 10, 2003
Messages
239
Hi,

I have a form which I set a button to open up another form, I set criteria to read another form supplier_code.

Please help to see the undermentioned code is correct.


Private Sub Command68_Click()
On Error GoTo Err_Command68_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm-principal's Brand"
DoCmd.OpenForm , AcFormView, stLinkCriteria, , "[supplier_code] =" & Me.[Supplier_Code]

Exit_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click

End Sub

Thank you
 
You missed the stDocName.... I have also left out AcFormView (note 3 , after stDocName)

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , "[supplier_code] =" & Me.[Supplier_Code]


Hope this helps,

Regards,
 
you did not put stDocName in your OpenForm and also what is the purpose of stLinkCriteria in your statement ?

that should be stLinkCriteria = "[supplier_code] =" & Me.[Supplier_Code]

and then use stLinkCriteria as your WHERE argument in your OpenForm command
 

Users who are viewing this thread

Back
Top Bottom