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
Solved

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

Posted on 2007-12-06
5
804 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
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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

856 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