?
Solved

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

Posted on 2007-12-06
5
Medium Priority
?
809 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:wiswalld
ID: 20419307
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
ID: 20420175
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 2000 total points
ID: 20420494
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
ID: 20420502
Let me know if you need further
0
 

Author Comment

by:davetough
ID: 20421308
thanks again
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

777 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