Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

910 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

20 Experts available now in Live!

Get 1:1 Help Now