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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Union Select with Cascading ComboBoxes

Status
Not open for further replies.

jw5107

Technical User
Jan 20, 2004
294
US
I'm implenting the classic combo box cascade setup on my form. I need to incorporate an alternative to "Not In List" for adding new records to one of the combo boxes.

In the Row Source of one of the combo boxes I have this: SELECT distinct StatusSheetMstr.StatusNo FROM StatusSheetMstr UNION SELECT "<Add New Status Sheet>" AS Expr1 FROM StatusSheetMstr WHERE (((StatusSheetMstr.FleetID) = Forms!BuildStatusSheet!cboFleet)) GROUP BY StatusSheetMstr.StatusNo;

When the 1st combo box is selected - the second shows ALL of the records instead of the ones based on - StatusSheetMstr.FleetID = Forms!BuildStatusSheet!cboFleet

As soon as I take the - UNION SELECT "<Add New Status Sheet>" AS Expr1 - out of the row source - the cascading works fine between the 2 combo boxes.
When "Add New Status Sheet" is selected from the 2nd combo box - an After Update event runs that prompts the user for a new Status Sheet#.

Any examples or suggestions???
Thanks in advance.
jw5107
 
And this ?
SELECT StatusNo FROM StatusSheetMstr WHERE FleetID=Forms!BuildStatusSheet!cboFleet UNION SELECT "<Add New Status Sheet>" AS Expr1 FROM StatusSheetMstr

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top