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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top