Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox OnChange resulting in Parameter Query popup

Status
Not open for further replies.

Gruuuu

Programmer
Oct 7, 2008
543
US
I have several comboboxes on a form, they each have a RowSource which is a simple query
For example:
Code:
SELECT DISTINCT Type FROM monsters;
When I change the value of the combobox by selecting it from the list, it gives me a "Please Enter a Parameter Value" popup. Which is annoying. How do I make it not do this?

The rest of the Change event instructions will run if I manually type the selection into the Parameter dialog. If I just hit Ok or Cancel, the Value in the combobox is still the item I select, but the events don't fire.
 
Ok, changed that! Thank you.
Still can't figure out the Parameter Query thing though.
 
It usually points to a typo. What parameter is it asking for?

(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - winXP Pro, Win7 Pro
Please respond to this forum so all may benefit
 
Yep, it WAS pointing to a typo.

This was my (modified) code:
Code:
strTypeSQL = " AND mType = " & cmbTypeSelect.Value
And, of course, the corrected code:
Code:
strTypeSQL = " AND mType = '" & cmbTypeSelect.Value & "'"
I had string values that did not live in single quotes.
Problem solved!
I should have figured it out when the only option that was numeric data didn't give me the same issue.
 
Outstanding! Great troubleshooting. Glad to hear you got it sorted.

(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - winXP Pro, Win7 Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top