Cascade Problem (1 Viewer)

tl mike

Registered User.
Local time
Yesterday, 23:46
Joined
Sep 7, 2007
Messages
117
In my db I have a cascade combo which on another form works fine between a productline and category, but on this for it wont let me do the same thing with Vendor and Manufacturer.

I get an error after I select the Vendor when it is supposed to set the criteria for the Manufacturer.

I have been working on this for over 3 hours and I think i did everything the same as I did on the other form of mine that works but cant get this to work. Please have a look and see if you see where i went wrong.
 

Attachments

  • Cascade Problem.zip
    220.3 KB · Views: 84

Call_Me_Sam

Chief Imperial Navigator
Local time
Today, 07:46
Joined
Feb 26, 2008
Messages
244
I get an error after I select the Vendor when it is supposed to set the criteria for the Manufacturer.

hi don't know if you got this sort Mike..but i think it's to do with the VendorID is a number but you are setting the rowsource to look for a string value

Code:
strSQL = "SELECT DISTINCT tblManufacturer.ManufacturerID FROM tblManufacturer "
strSQL = strSQL & " WHERE tblManufacturer.VendorFK = [COLOR=blue]'[/COLOR][COLOR=red]" & cboVendor & "[COLOR=blue]'[/COLOR]"
[/COLOR]strSQL = strSQL & " ORDER BY tblManufacturer.ManufacturerID;"

A handy tip i do when building SQL statements in code is add "Debug.print" so the SQL is printed in the immediates window (CTRL + G to view) then copy that into a blank query and run it. I find it easier to play with the SQL then, and correct it back in the code
 

tl mike

Registered User.
Local time
Yesterday, 23:46
Joined
Sep 7, 2007
Messages
117
Sam

Thanks for the reply I had figured out another way by using queries and setting the criteria for secound combo boxes query to the first combo box. Then in the after update for the first combo box added in VBA to requery the secund combo box.

It works without interfering with the save feature on the form and havent seen any other glitches from the form.
 

Users who are viewing this thread

Top Bottom