473,785 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo boxes on form not populating with stored data

12 New Member
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 3059
missinglinq
3,532 Recognized Expert Specialist
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
jgoodnight
12 New Member
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
jgoodnight
12 New Member
twenty character bump
Aug 5 '08 #4
NeoPa
32,578 Recognized Expert Moderator MVP
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
jgoodnight
12 New Member
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 Recognized Expert Specialist
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
jgoodnight
12 New Member
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 Recognized Expert Specialist
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,578 Recognized Expert Moderator MVP
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

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

Similar topics

2
3072
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 displays data dependent on what has been typed in. After having trouble with populating my second combo box (I eventually populated it by putting the fields for both combo boxes in 1 separate query) I am now having problems with the 3rd one and am...
8
2203
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 Product where as the Row Source (See properties): SELECT tblProducts.ProductName, tblProducts.ProductName FROM tblProducts ORDER BY ProductName;
4
64642
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 determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
6
3683
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
2908
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 main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc) and a subdatasheet (the subform...let's call it subInfo) below the combo boxes on the RD Form. I hope this eliminates any confusion of the
2
3268
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 selecting from the combo box, I have all the combo boxes, using afterupdate, populating their respective list boxes. These text boxes are directly correlated to the combo box selection using SQL. Here is an example from the afterupdate event in the...
2
4618
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 appears in the text box.
0
1959
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, which I then assign to the datasource. Some of my combo box datasources depend on values in other fields to limit the options. For example, I have a sales rep list that is limited by the customer selected in the customers combo box. And...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.