473,380 Members | 1,408 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,380 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 3031
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,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.