473,473 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Show/Hide form fields based on values in other field

Looking to do sort of the same thing you see on websites, but on
access form, where when a value is selected from a drop down list, if
it matches the desired value, certain form fields appear.

For example, the records in my table are one of three types of
records, Owner, Member or Independent. I have fields in the table that
only correspond to Owner records and only want those fields showing on
the form if the CompanyType is selected as Owner.

It is the same with Member and Independent. Although it's not
important, it would be cool if this could happen in the same space on
the form.

Can anyone help?

Aug 2 '07 #1
1 19064
magmike <ma******@yahoo.comwrote in
news:11**********************@m37g2000prh.googlegr oups.com:
Looking to do sort of the same thing you see on websites, but
on access form, where when a value is selected from a drop
down list, if it matches the desired value, certain form
fields appear.

For example, the records in my table are one of three types of
records, Owner, Member or Independent. I have fields in the
table that only correspond to Owner records and only want
those fields showing on the form if the CompanyType is
selected as Owner.

It is the same with Member and Independent. Although it's not
important, it would be cool if this could happen in the same
space on the form.

Can anyone help?
Sure...Each textbox has a visible property. Create a sub
procedure in the form's code module, and call that sub from the
form's current event, and the dropdown's afterUpdate event, too.

You didn't give control names, so use this as a template.

private sub cboRecordType_ShowHide()
select case cboRecordType
case "Owner"
me.txtaaaa visible = true
me.txtbbbb.visible = False
me.txtcccc.visible = false
case "Member"
me.txtaaaa visible = false
me.txtbbbb.visible = true
me.txtcccc.visible = false
case Else
me.txtaaaa visible = false
me.txtbbbb.visible = false
me.txtcccc.visible = true
end select
end sub



--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 2 '07 #2

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

Similar topics

1
by: Sean Abrahams | last post by:
The following is a reprint of a message I sent to the tutor list a long time ago, that I haven't gotten around to discussing with anyone else and failed to hear a reply on the tutor list. Hoping...
9
by: Jack | last post by:
Hi, I got a asp form page where the POST ACTION = confirmation.asp page is used to save the values collected from text boxes from the form in a database. For example txtTotalOutlay field is being...
9
by: sergio | last post by:
Hi all, I have created the following script that will show/hide a menu based on checkboxes. It works fine in Opera but not on IE6! Does anybody knows a workaround this problem? Thanks for your...
15
by: Paul T. Rong | last post by:
Hi everybody, This time a very very difficult case: I have a table "tblStudent", there are 50 students, I also made a form "frmStudent" based on "tblStudent", now if I don't want to show all...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
3
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
14
by: Thurston Manson | last post by:
Suppose I'm using an implementation where an int is 16 bits. In the program below, what function is called in the first case, and what is called in the second case? Also, if there is a difference...
3
by: steveninfl | last post by:
Hello , I am using MS Access 2000. I have a Table called Transactions, I have created a form for this table, one of the fields on the form is a combo box with the row source type as value list. In...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.