473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Combo boxes on form not populating with stored data

Hi,

I have a form with three combo boxes: Area, Sub-Area, and Factor. I've set up the Sub-Area combo box to list only those areas that are part of the selected area. I've set up the Factor combo box to list only those factors that are part of the selected sub-area.

For example, if I select area 1.0, the Sub-Area combo box displays 1.1, 1.2, and 1.3 as options. It does not show 2.1, 3.1, etc.

If I select area 2.0, the Sub-Area combo box displays only 2.1, not 1.1, 1.2, 3.1, etc.

I think you get the idea.

The combo boxes are working properly and the data is being stored in the table correctly. However, when I go back and view the records through my form, the combo boxes are empty. When I click on the empty combo box, the correct value is highlighted in the list... it just wasn't showing when I first look at the record.

Any ideas on how to have the combo boxes correctly populate with the stored values?
Aug 1 '08 #1
11 3029
missinglinq
3,532 Expert 2GB
In order for a given record to retain the value of its comboboxes when you leave the record and then return, the comboboxes have to be bound to fields in the underlying table. When you select a combobox and go to its Properties sheet, does it have anything listed under Control Source?

Welcome toes Bytes!

Linq ;0)>
Aug 1 '08 #2
Yes, sorry I didn't make that clear originally. The data is being stored in the tables... the control sources are set up properly.

The issue that when I go back and look at records through the form, the field doesn't populate until I click into the combo box.
Aug 1 '08 #3
twenty character bump
Aug 5 '08 #4
NeoPa
32,556 Expert Mod 16PB
When you say the field (control) doesn't populate, do you mean that the selected item is not shown in the unopened ComboBox?

If not, what do you mean exactly?
Aug 10 '08 #5
Yes, the selected item is not shown in the unopened combo box. When I click into the combo box, the selected item appears. The selected item will then stay visible as long as I view that record. When I go to the next record and then come back, the selected item is hidden once again.
Aug 14 '08 #6
missinglinq
3,532 Expert 2GB
If the comobox itself has a Control Source set, it shouldn't do that. It sounds as if something in the OnCurrent event is setting the combobox default back to no selection. My only other guess would be some weird for of corruption, in which case deleting the combobox and recreating it would be the answer.

Linq ;0)>
Aug 14 '08 #7
I have a form with three combo boxes: Area, Sub-Area, and Factor. I've set up the Sub-Area combo box to list only those areas that are part of the selected area. I've set up the Factor combo box to list only those factors that are part of the selected sub-area.

For example, if I select area 1.0, the Sub-Area combo box displays 1.1, 1.2, and 1.3 as options. It does not show 2.1, 3.1, etc.

If I select area 2.0, the Sub-Area combo box displays only 2.1, not 1.1, 1.2, 3.1, etc.
In order to implement this design I use requery macros for the On Click and On Enter events of the combo box. Basically when I make a selection in the Area combo box, I want the Sub-Area choices to be tailored to that Area.

Perhaps these requery macros are to blame?
Aug 14 '08 #8
missinglinq
3,532 Expert 2GB
Few of us here use Macros, but Requerying a combobox normally will reset it, so that may be the problem. Maybe someone will stop by who does use Macros.

Linq ;0)>
Aug 14 '08 #9
NeoPa
32,556 Expert Mod 16PB
If you were to reproduce the macro functionality in VBA, then you would have the opportunity of coding it to save the value before the requery, then simply setting it again afterwards. That might do the trick for you.
Aug 14 '08 #10
Huzzah!

I replaced the macros with VBA such that in the "After Update" event of a combo box I requery the next combo box down the line. This still left me with the original problem of invisible values when navigating through records.

I fixed that by requerying each of the combo boxes in the form's "On Current" event.

Thanks so much for your help neo and linq.

*Edited for grammar
Aug 15 '08 #11
NeoPa
32,556 Expert Mod 16PB
You're welcome.

We're very pleased we could help :)

Wecome to Bytes!
Aug 15 '08 #12

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

Similar topics

2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a...
2
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once...
2
by: SHAWTY721 | last post by:
I have a form that contains two combo boxes that are related to each other. I need to find a way to populate my text box based on the criteria of the two combo boxes so the appropriate number...
0
by: Dawnyy | last post by:
I have a form which is bound to a dataset. I am filling the forms dataset on Form_Load event. On my form I have combo boxes which I am setting by running a stored procedure to return a datatable,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.