473,513 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo boxes - Changing behaviours/locking combo boxes

108 New Member
I have Three combo boxes that ideally I want the the users to access in the correct sequence as they depend on the value within the combo box before them.

#1 Facility
#2 Area
#3 Sport

I.e. If Facility is blank the vba code behind Form (On current) updates the Area combo box fails as its expects a value.

Private Sub Form_Current()
Me.comboArea.RowSource = "Select Area.Area_ID, Area.Area, Facility.Facility " & _
"FROM Facility INNER JOIN Area ON Facility.Facility_ID = Area.Facility_ID " & _
"WHERE Area.Facility_ID = " & Me.combofacility.Value & ";"

Me.comboSport.RowSource = "Select Sport_ID, Sport " & _
"FROM Sport " & _
"WHERE Sport.Area_ID = " & Me.comboArea.Value & ";"
End Sub

So is there a method to force them to enter values in the combo boxes in that set order/locking the others out?

Also another issue which is confusing me is that If I change say the facility after all the other combo boxes are populated, it wont impact the values in the other combos making some data incorrect.

I expected this but even though I forced 'Enforced Referential Integrity'
I didnt expect the data to be saved, expected database error.

I know this would be hard to diagnose without detailed info,
Ive attached piccy of my relationships, hopefully easier to understand than my mad ramblings.

Nov 24 '06 #1
1 1308
NeoPa
32,557 Recognized Expert Moderator MVP
So is there a method to force them to enter values in the combo boxes in that set order/locking the others out?
You could start with them all (except the first) being disabled and enable them in the AfterUpdate event of the previous control to handle the order.

Also another issue which is confusing me is that If I change say the facility after all the other combo boxes are populated, it wont impact the values in the other combos making some data incorrect
It will affect the data selected in your form (each change) so a requery will be required after each (all) of the combo boxes is changed.
It's not clear that it will change the data in the other combo boxes, but if it does then this, also, should be requeried. In this case, the form data should not really be displayed until all boxes are reselected. The form could perhaps be hidden unless all the combo boxes are correctly selected.
Nov 25 '06 #2

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

Similar topics

3
9351
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
1
1585
by: Dalan | last post by:
Sometime ago I had inserted two Combo Boxes on a form (cboCustomers) and (cboVendors) to lookup values in separate tables. They have worked fine except now I want to increase their usage by...
2
5434
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
0
2364
by: Andrew | last post by:
Hello, I am trying to create a chart whose underlying query is linked to 2 combo boxes on the same form. I want to pass the values from the combo boxes into the chart query to allow the chart...
14
4945
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
5
2205
by: consonanza | last post by:
I am working on a report filter form. It has 2 combo boxes (cmboSelectSubject and cmboSelectCategory) to select criteria. Selecting an entry in combo 1 restricts the options available in combo 2....
6
3667
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
6
1762
by: dougmeece | last post by:
Hello, I have a form that I would like to auto-populate text boxes in based on the selection made from a combo box. I have set the form record source to a table "SubmittedTo" which contains 3...
8
11975
by: jmartmem | last post by:
Greetings, I have an Access 2002 continuous form called "Project Update Form" in which users can update project values presented in a series of combo boxes and text boxes. I have three combo boxes...
0
7260
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,...
0
7384
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,...
1
7101
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...
0
7525
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...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5089
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...
0
4746
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...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.