Parameter value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a db that uses a listbox row to open a form based on the customerID
when the listbox row is double clicked. When I double click the row, I get a
enter parameter value box that pops up. The interesting thing is, that the
value that needs to be entered is already in the pop up box, right above the
textbox area.

here is the code used to open the form:

Private Sub lstCustInfo_DblClick(Cancel As Integer)
'Open frmCustomer based on the ID from lstCustInfo listbox

DoCmd.OpenForm "frmCustomers", , , "[CustomerID]= " & Me.lstCustInfo.Value,
, acWindowNormal
 
What is the datatype for CustomerID? If it is text, you must surround
the value with quotes, like this:

DoCmd.OpenForm "frmCustomers", , , "[CustomerID]= '" & lstCustInfo & "'"
The interesting thing is, that the
value that needs to be entered is already in the pop up box

That's your cue for next time with parameter trouble.
 
That was indeed the issue I was running into. Thanks...

Bas Cost Budde said:
What is the datatype for CustomerID? If it is text, you must surround
the value with quotes, like this:

DoCmd.OpenForm "frmCustomers", , , "[CustomerID]= '" & lstCustInfo & "'"
The interesting thing is, that the
value that needs to be entered is already in the pop up box

That's your cue for next time with parameter trouble.
 
Back
Top