Help! Open form Where Condition

joaompc

Registered User.
Local time
Yesterday, 22:06
Joined
Sep 13, 2012
Messages
39
I have a table with several records. I want to click on a specific record and open a dialog form with the record details.

I am using this code, but the form opens empty, without the record fields.

Dialog form name is MR Detail

And I want to click on the field "Address" that is a string

Both forms have the same table bound.

Private Sub Name_Click()
Dim stForm As String
Dim stLinkCriteria As String

stForm = "MR Detail"

stLinkCriteria = "[Address]= " & [Address]
DoCmd.OpenForm stForm, , , , , , stLinkCriteria

End Sub

Thanks
 
Unless Address is a nummeric field your filter will not return records.
Address normally is text so your stLinkCriteria should look like:
Code:
stLinkCriteria = "[Address]= [COLOR="Red"]'[/COLOR]" & [Address] [COLOR="red"]& "'"[/COLOR]
 
Thank you!

It works now!
 

Users who are viewing this thread

Back
Top Bottom