473,624 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

4 possible options (based on value combination from 2 combo boxes)

3 New Member
hi,

on my form there are 2 combos (ms access)

combo1 contains values: 1, 2, 3, 4, 5
combo2 contains values: a, b, c, d, e

if you choose 1 or 2 or 3 from combo1 and a or b from combo 2 it should make label1 visible

if you choose 4 or 5 from combo1 and a, b, c, from combo2 it should make label1 visible & label2 visible

if 4 or 5 & d or e make label2.visible = true

else
label2.visible = false
label1.visible = false

any idea how to make this working? (my problem is writing of the conditions
Oct 10 '07 #1
1 1356
nico5038
3,080 Recognized Expert Specialist
hi,

on my form there are 2 combos (ms access)

combo1 contains values: 1, 2, 3, 4, 5
combo2 contains values: a, b, c, d, e

if you choose 1 or 2 or 3 from combo1 and a or b from combo 2 it should make label1 visible

if you choose 4 or 5 from combo1 and a, b, c, from combo2 it should make label1 visible & label2 visible

if 4 or 5 & d or e make label2.visible = true

else
label2.visible = false
label1.visible = false

any idea how to make this working? (my problem is writing of the conditions
I would probably create a table with 3 fields:
Combination TEXT (being 1a, 1b, 1c, etc)
Label1 Boolean (YesNo field holding True or False)
Label2 Boolean (YesNo field holding True or False)

Now you can put all combinations in the table and use the value for label1 and label2 to set the correct value, like:

Me.label1.visib le = NZ(Dlookup("lab el1","tblLabels ","Combination= '" & me.combo1 & me.combo2 & "'"),False)
Me.label2.visib le = NZ(Dlookup("lab el1","tblLabels ","Combination= '" & me.combo1 & me.combo2 & "'"),False)

The Dlookup will return nothing when a combination isn't found and the NZ() function will set then the default value to False. This way combinations not needing a label1 and/or label2 don't have to be defined in the table.

Idea ?

Nic;o)
Oct 10 '07 #2

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

Similar topics

3
11095
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I have a primary form named TestResults, which is connected to data in a table named TestResults. There are basically two other tables that are related to the TestResults table (and the primary form) named Names-Normalized and SiteAddresses. The...
3
2573
by: joni b | last post by:
I need help limiting the options shown in a combo box. I have two combo boxes that appear in a datasheet view subform. The form looks like an Excel spreadsheet, which is what the user prefers. Among the fields in the table are two combo boxes: 1) Product Family 2) Products When the user is adding data, the Products list is easily limited to only the products in the product family using an unbound combo box. I
15
2955
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
5
2210
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. The row source for combo2 is: SELECT DISTINCT tblComplaintCategory.fldComplaintCategory, tblComplaintCategory.fldComplaintCategoryID, tblComplaintSubjects.fldComplaintSubjectID
0
901
by: =?Utf-8?B?UmVkYmFjaw==?= | last post by:
I am trying to implement a data entry for a timesheet. I'm using VB.net 2005. Using a datagridview, I want to have the datagridview bound to a table. Lets say the table has timesheet data for lots of employees for different days. An employee will can be working on a job. Each job has 1 to many cost codes
1
1288
by: Jon1492 | last post by:
I've been trying to figure this out for a few hours now. I have an MS Access 2003 quote configuration tool that produces quotes based on about 100 different controls (including option groups, combo, list and text boxes, etc) that an end-user selects. I imagine that these controls will change in the future, so I want flexible 'what did the end user click on to produce this quote' report. I don't want to have to change the code behind this...
1
1910
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C Select Box 1
9
4986
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far created three combo boxes that cascade down from Name to Project to Date and when this has been chosen I have four textbox fields I want to display based on this selection. I tried linking the last combo box comboDate to update these fields after...
3
5860
by: dufnobles via AccessMonster.com | last post by:
I have a form that displays a dropdown box. The options in the drop down vary according to a value queried from a database boolean (Yes/No) field. I would like to do the following: If the boolean value is True, then the dropdown options will be option1 and option2. If the boolean value is False, then the dropdown box will contain: option1, option2 and option3.
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
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
8629
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
8341
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
7170
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
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
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
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 we have to send another system
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.