Enter Parameter Value?

satoshi79

New member
Local time
Tomorrow, 01:35
Joined
May 25, 2003
Messages
5
Private Sub Form_Click()
Dim whereStr As String

whereStr = "[BuyerID] = " & Me![BuyerID] & " AND [PropertyID] = " & Me!PropertyID

DoCmd.OpenForm "frmBuyersInterestedPropertiesDirectory", acNormal, , whereStr

End Sub

When I run the form, I was prompted with a screen requesting for Enter Paramater Value for B1, I will then enter 'B1' and the process is
repeated for P2 and I will enter 'P2'.

The issue here is that the parameter are not captured for some reasons that's why the system is asking me to enter parameters.

Although the right record will be shown. This did not occur when I use

DoCmd.OpenForm "frmBuyerDirectory", acNormal, , "[BuyerID]='" + Me!
[BuyerID] + "'"
- for other forms.

'the parameter (buyerid) is captured, but why not when I have two parameters

Why is this so?

Thank you
 
Not to sure but could it be that you're missing the single quotes ' from you whereStr!

What if you change it to -

whereStr = "[BuyerID] = '" & Me![BuyerID] & "' AND [PropertyID] = '" & Me!PropertyID & "'"
 

Users who are viewing this thread

Back
Top Bottom