Cascading comboboxes error?

KingBroil

Registered User.
Local time
Today, 15:29
Joined
Oct 3, 2012
Messages
41
Hi,

I want to use cascading comboboxes on a form. When I try my form, Access return an error message:

The record source 'PhyLoc FROM Location WHERE GeoLoc = 'Quebec City' ORDERED BY GeoLoc' specified on this form or report does not exist.

I red some threads about it, and a lot of googling, it got me a long way, but I can't seem to figure what I am missing here..

The first CB row source is from a query and the second is from the table Location.

Code:

Private Sub cmbGeoLoc_AfterUpdate()
On Error Resume Next

cmbPhyLoc.RowSource = "PhyLoc " & _
"FROM Location " & _
"WHERE GeoLoc = '" & cmbGeoLoc & "' " & _
"ORDER BY GeoLoc"

End Sub

The attached picture is a snapshot of the table Location.

A hint on this would be much appreciated.
 

Attachments

  • Access screenshot.jpg
    Access screenshot.jpg
    51.2 KB · Views: 75
You forgot SELECT:

cmbPhyLoc.RowSource = "SELECT PhyLoc " & _
 
Cascading comboboxes error? - Resolved

Hi pbaldy,

It worked,
I made the change like you said. At first the list items in my second CB were invisible; They were there and I could click on them, but I couldn't see them.

I then googled: "Combo box list invisible" and after a while I figured that somehow the column count of my second CB was set to "2". I set it to "1" and it made the choices reapear. I'm not sure I understand the principles there, but it worked.

Now the cascade works perfectly, Thanks a lot!
 
Happy to help! The row source, column count and column widths properties all work together to present the list as desired.
 

Users who are viewing this thread

Back
Top Bottom