473,748 Members | 10,028 Online
Bytes | Software Development & Data Engineering Community
+ 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 19077
magmike <ma******@yahoo .comwrote in
news:11******** **************@ m37g2000prh.goo glegroups.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_S howHide()
select case cboRecordType
case "Owner"
me.txtaaaa visible = true
me.txtbbbb.visi ble = False
me.txtcccc.visi ble = false
case "Member"
me.txtaaaa visible = false
me.txtbbbb.visi ble = true
me.txtcccc.visi ble = false
case Else
me.txtaaaa visible = false
me.txtbbbb.visi ble = false
me.txtcccc.visi ble = 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
1910
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 someone here may want to have some dialog. -- I'm learning to write unit tests and am trying to write them for a web application I'm working on.
9
2177
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 used in confirmation.asp page to update a database field. However, there is a field in the form which is calculated field e.g. NetOutlay = .90 * txtTotalOutlay. This NetOutlay is thus not a text field. However, in the confirmation field I...
9
2768
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 response. Sergio ------------------------------------------------ <script language="JavaScript" type="text/javascript">
15
2303
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 the students in a classical (vertically, from top to bottom) way, but make them "sitting" in 50 text boxes, 5 rows 10 columns, how to do it? Thanks in advance.
4
7017
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
3
7730
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 am finding this sort of problem by far the most annoying part about working with ASP.NET controls. What I want is to know how to do three things: - conditionally show or hide an ImageField +column+ based on whether or not an the...
2
5545
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 Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where...
14
2134
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 between C89 and C99, I would like to know. I have tried with different compilers, and I see some differences. Before I file a bug report with my C vendor, I would like to know what the correct behavior is. struct S { unsigned a:4;
3
24569
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 this combo box field that I call "Transaction type" the user must select a value from the drop down list. What I want to do is based on the selection of the "Transaction type" field, if the user should select a transaction type of ADHOC or...
0
8823
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
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 we have to send another system
2
2775
muto222
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.