By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,933 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,933 IT Pros & Developers. It's quick & easy.

Cascading Combo Boxes in a Tabular Form

P: 4
Hi Everyone.

I've been having a little touble with a form I'm working on. (I'm a MS Access hobbiest). I've set up the cascading combo boxes, which is working, (I took the code from Microsoft) on a single item form.
However as the form I need is a of tabular type, every time I update cbo1 to a value, the non matching cbo1's cbo2 field blanks out. The data remains as but is hidden, and not what I need.

The data is all linked to bound fields.

All the VBA code I'm using is just an AfterUpdate requery on both combo boxes, and a requery on Form_Current. (I'm not well versed in VBA)

The data should show as follows:

cbo1 - cbo2
-----------------------------
Apple - Macintosh
Apple - Grany Smith
Orange - Mandarin
Orange - Naval
Banana - Generic
Orange - [New Data Here]

However what is displayed is as follows:

cbo1 - cbo2
-----------------
Apple - [Blank]
Apple - [Blank]
Orange - Mandarin
Orange - Naval
Banana - [Blank]
Orange - [New Data Here]

Any help you can give would be great!

The ShadowHawk
Jun 9 '07 #1
Share this Question
Share on Google+
2 Replies


P: 4
Ok. What I've done to see the value of the cell is place an text box over the combo box. While this shows the index number, I want to show the actual text like in the combo box.

How do I get the Text box to look up the following:

SELECT stbl_Service_Item.SubService_ID, stbl_Service_Item.Sub_Service_Details, stbl_Service_Item.Service_ID
FROM stbl_Service_Item
WHERE (((stbl_Service_Item.Service_ID)=Forms!main!Servic e!Service_Item))
ORDER BY stbl_Service_Item.Sub_Service_Details;

And display only "stbl_Service_Item.Sub_Service_Details"
Jun 9 '07 #2

puppydogbuddy
Expert 100+
P: 1,923
Ok. What I've done to see the value of the cell is place an text box over the combo box. While this shows the index number, I want to show the actual text like in the combo box.

How do I get the Text box to look up the following:

SELECT stbl_Service_Item.SubService_ID, stbl_Service_Item.Sub_Service_Details, stbl_Service_Item.Service_ID
FROM stbl_Service_Item
WHERE (((stbl_Service_Item.Service_ID)=Forms!main!Servic e!Service_Item))
ORDER BY stbl_Service_Item.Sub_Service_Details;

And display only "stbl_Service_Item.Sub_Service_Details"
Save your query and use the saved query in a DLookup to display its results in a textbox like this:
Expand|Select|Wrap|Line Numbers
  1. YourTextbox.Value = DLookup("[stbl_Service_Item.Sub_Service_Details]","YourQuery")
  2.  
Jun 10 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.