Hi. I am new to this site and to database programming...
I have a form where I have placed a button, which when clicked, I want to open another form at the relevant record.
I'll try to explain this. The form which I am starting from called Case Details has a field in it called Customer which is not the primary ID field, but is pulled from the primary ID of a related table.
When I click on the button on this form, I need another form to open - Customer Details and I need it to open on the record for the current customer in Case Details. The matching field in Customer Details is called 'Company' and consequently I have the following code which isn't working...!
Private Sub CustomerDetails_Click()
DoCmd.OpenForm "Customer Details", acNormal, , "[Company]=" & Me![Customer]
End Sub
I have tried using code from similar threads on here and I have tried copying and amending macros that previously existed in the database but all to no avail, so I would be very grateful for any help.
Many Thanks,
Hazel.
I have a form where I have placed a button, which when clicked, I want to open another form at the relevant record.
I'll try to explain this. The form which I am starting from called Case Details has a field in it called Customer which is not the primary ID field, but is pulled from the primary ID of a related table.
When I click on the button on this form, I need another form to open - Customer Details and I need it to open on the record for the current customer in Case Details. The matching field in Customer Details is called 'Company' and consequently I have the following code which isn't working...!
Private Sub CustomerDetails_Click()
DoCmd.OpenForm "Customer Details", acNormal, , "[Company]=" & Me![Customer]
End Sub
I have tried using code from similar threads on here and I have tried copying and amending macros that previously existed in the database but all to no avail, so I would be very grateful for any help.
Many Thanks,
Hazel.