473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Invisible Combo Box

I have a simple form, frmProduct, with a combo box, cboStatus, that has
2 choices: "Active" and "Inactive." If I chose "Inactive," then I want
another combo box to appear, cboInactiveStatus, which has the following
choices: "Transferred" or "Sold."

How do I make the combo box, cboInactiveStatus, invisible until
"Inactive" is chosen in the first combo box, cboStatus?

Here is some additional info on my tables:

tblStatus

A Active
I Inactive

tblInactiveStatus

T Transferred
S Sold
Thanks a bunch,

Megan

Nov 13 '05 #1
5 4660
Megan,
You need just 1 line of code here:
Me!cboInactiveStatus.visible=Me!cboStatus ="Inactive"
Use the code in the form's OnCurrent-event and in cboStatus_AfterUpdate

--
Hope this helps
Arno R

<me**************@hotmail.com> schreef in bericht news:11**********************@z14g2000cwz.googlegr oups.com...
I have a simple form, frmProduct, with a combo box, cboStatus, that has
2 choices: "Active" and "Inactive." If I chose "Inactive," then I want
another combo box to appear, cboInactiveStatus, which has the following
choices: "Transferred" or "Sold."

How do I make the combo box, cboInactiveStatus, invisible until
"Inactive" is chosen in the first combo box, cboStatus?

Here is some additional info on my tables:

tblStatus

A Active
I Inactive

tblInactiveStatus

T Transferred
S Sold


Thanks a bunch,

Megan

Nov 13 '05 #2
Megan,

While the other solution posted will do want you want...why?
If the choices you listed are the only ones that will be available,
wouldn't it be simpler to have the first combo-box have 3 options:
A Active
IT Inactive - Transferred
IS Inactive - Sold

This would then make reporting a very simple process too.

Just a thought.
Mal.

Nov 13 '05 #3
I keep getting a Runtime Error 13: Type Mismatch.

My tables have the following columns:

tblStatus

StatusID (PK & Text) StatusDesc (Text)
A Active
I Inactive

tblInactiveStatus

InactiveStatusID (PK & Text) InactiveStatusDesc (Text)
T Transferred
S Sold

In my row source for my combo box, cboStatus, I include both the PK,
StatusID, and the description, StatusDescription, but I hide the PK
field (as suggested in the combo box wizard). So, should I be using "I"
instead of "Inactive" since the combo box is storing the PK? However
when I do that, I still get the same run-time error 13. Should I use an
number like '1" as my PK instead of text like "I?"

Thanks!

Megan

Nov 13 '05 #4
I just added the following code to the On Current Event of my form:

Me!cboInactiveStatus.Visible = False

And I added the following code to the After Update Event of my combo
box, cboStatus:

If Me!cboStatus = "I" Then
Me!cboInactiveStatus.Visible = True
End If
Thanks for the advice!

Megan

Nov 13 '05 #5
Good point! I just came from a meeting and maybe I was over-analyzing
the whole matter! DUH!

Megan

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: jdph40 | last post by:
Is there any way to do this on a form in Access 97? If the value of a combo box is .5, I want two check boxes to be visible (labels are a.m and p.m.). If the value of the combo box is 1, I want...
2
by: Todd | last post by:
Hi. I want to sort the records on my form (using either a continuous form or a datasheet) by the unbound "description" column in a combo box on the form (or in the datasheet.) Here's a rough...
10
by: Cy | last post by:
I've had good luck with posting in the past, so we'll see how things go this time...:) I have an Access 2000 form. On the form is about 40 objects. I want to set everything to invisible,...
1
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
5
by: philiprodley | last post by:
Returning to Access after years of break! Have combo box on form populated with 3 records: Height Weight Width I wish to make height fields visible on the form if I select height, but...
0
by: annivanova | last post by:
Hi, I saw posts in Dependent listboxes on access forms, which problem is very similar to my. I’m working over to create an MS Access application. I used in my project given code : Code:...
2
by: Zulema | last post by:
I have 2 combo boxes. When the user chooses "value" the second combo box becomes visible and this is what i want it to do, but how can i keep the 2nd combo box visible if and only when the first box...
0
by: Kelii | last post by:
evenlater, ok, so i think the thing that we have to get our heads around here is that there is no way to identify the selected fields in a recordsource without first opening the report. so, i...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.