Solved

using if statement on a form based on one combo box to fill another

Posted on 2007-12-06
5
801 Views
Last Modified: 2008-02-01
Hello,
I am using an access form.
I use an if statement : If me.cboOne = "14545" Then
me.txtOne = "LC12 GB"
I base the text box on what the combo box is.
QUESTION: Is there a way to base a 2nd combo box on what first combo box is?
thank you
0
Comment
Question by:davetough
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:wiswalld
Comment Utility
If you are trying to base a combo box on another try this.

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23000738.html?cid=236#a20404439

That would be if you have multiple columns in a table and if the first column equals lets say 1 then only options where the first column equalled 1 would show in the second combobox.

Is that what you mean or just a simple if statement?
0
 

Author Comment

by:davetough
Comment Utility
I guess I mean a simple statement
like  If me.cboOne = " choice one" Then
me.cboTwo = ( choice one, choice two, or choice three)
can you do it anyway like that?
or is your solution more the way you have to do it?
thanks
0
 
LVL 13

Accepted Solution

by:
wiswalld earned 500 total points
Comment Utility
If you have a table set up like this then the first solution would be your best option

1      Doug
2      Dave
2      Jennifer
2      Alyssa
3      Sally

So if you select 2 in combo1 then only Dave, Jennifer and Alyssa would appear in combo2.

You can write a long If statement but that depends on how many items are in you first combobox

If Me.Combo1 = "1" Then
Me.Combo2 = "2"
Else
If Me.Combo1 = "2" Then
Me.Combo2 = "3"
End If
0
 
LVL 13

Expert Comment

by:wiswalld
Comment Utility
Let me know if you need further
0
 

Author Comment

by:davetough
Comment Utility
thanks again
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now