Parameter Value Error when doing Cascading combo boxes (1 Viewer)

kujospam

Registered User.
Local time
Yesterday, 21:47
Joined
Jun 12, 2013
Messages
15
Sorry, I have been looking for the last few days on how to do this. Either I'm not searching right, or I'm the only person who had trouble following other people doing cascading combo boxes. I tried following microsoft example and several others but my problem comes up when I click on Group in Ticket list, I get a parameter value popup. I know I'm getting it from my Where statement that is supposed to setup the row source for Category. I tried using numbers and text but I messed up somewhere when it comes to the vba.

Me.cboCategory.RowSource = "SELECT DISTINCT Category.Categories FROM" & _
" Category WHERE GroupName = " & Me.cboGroup & _
" ORDER BY Category.Categories"
Me.cboCategory = Me.cboCategory.ItemData(0)
 

Attachments

  • Desktop issue tracking sent copy.accdb
    1.2 MB · Views: 69

Isskint

Slowly Developing
Local time
Today, 02:47
Joined
Apr 25, 2012
Messages
1,302
welcome kujospam

That should probably be;
Me.cboCategory.RowSource = "SELECT DISTINCT Category.Categories FROM Category WHERE GroupName = '" & Me.cboGroup & "' ORDER BY Category.Categories;"

GroupName is a text value so the parameter needs to be enclosed in quotes.

However... Having had a quick look though the DB, on the Lists table GroupName is a text value, but the look up table Groups, using a number ID so any table that has GroupName in it should be a number.
 

kujospam

Registered User.
Local time
Yesterday, 21:47
Joined
Jun 12, 2013
Messages
15
Thank you so much. That works perfectly now. I wasn't sure at first if it needed quotes, and when I did try it, I wasn't sure how to put them in. All I did was put the single quote before and after the double quotes around the cbo like you have them. Thank you a ton.
 

Users who are viewing this thread

Top Bottom