473,394 Members | 1,715 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,394 software developers and data experts.

enable/dissable text boxes based on value entered into a different one

hi,

am working on building a form in MS ACCDESS:

I have there some combos & some textboxes.

I want to create a macro about behaviour of 3 of those:

textbox1, textbox2 & textbox3 should be active if value from combobox = answer1
if it is so, I need also to make these 3 textboxes mandatory

if the value of the combobox is different, those textboxes should be dissabled

please help.. am lost
Sep 25 '07 #1
1 1770
hi,

am working on building a form in MS ACCDESS:

I have there some combos & some textboxes.

I want to create a macro about behaviour of 3 of those:

textbox1, textbox2 & textbox3 should be active if value from combobox = answer1
if it is so, I need also to make these 3 textboxes mandatory

if the value of the combobox is different, those textboxes should be dissabled

please help.. am lost
if you're using a single form view this will be straightforward; I prefer select case rather than if then else procedures;

select case me![mycomboboxname]
case 1
me.[textbox1].enabled = true
me.[textbox2].enabled = true
me.[textbox3].enabled = true
case 2
me.[textbox1].enabled = false
me.[textbox2].enabled = false
me.[textbox3].enabled = false
case 3
me.[textbox1].enabled = true
me.[textbox2].enabled = true
me.[textbox3].enabled = true
case else
me.[textbox1].enabled = false
me.[textbox2].enabled = false
me.[textbox3].enabled = false
end select

If you're using a continuous form, welcome to a world of pain in this respect, as you can't have different enabled properties for each instance of the form, just some limited conditonal formats. The best trick seems to be to use a text box to hide the control in this situation, by changing it's colours according to the condition of a field.
Sep 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
13
by: Shannan Casteel via AccessMonster.com | last post by:
I set up two tables (one with the regular claim info and another with ClaimNumber, PartNumber, and QuantityReplaced). The ClaimNumber is an autonumber and the primary key in both tables. I made a...
0
by: grgimpy | last post by:
My form has two main text boxes that are not working correctly with the code I wrote. Upon opening the form, the operator must select a "Part Number" from a list box. Once a "Part Number" is...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
7
by: ljungers | last post by:
Have a need to reference a value in 1 or 2 text box(s) on a prior form. Based on the value(s) entered, I may need to clear out 1 or 2 value(s) that where entered but not required in a couple of text...
1
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C ...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.