473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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 1789
Kevin Wilcox
68 New Member
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
6926
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 JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
4
6314
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 the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
1
4252
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 is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
13
2695
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 one to one relationship between the two tables. I have a form for the parts. It includes 25 text boxes for both the part numbers and the quantities, so 50 total. I set the control sources for each of the part number text boxes to PartNumber...
0
2411
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 selected, some code fills in some parameters in other text boxes and brings up a subform based on a query. This all works fine. The operator must then enter in eight "Thickness" values. Once the last value is entered, three text boxes should calculate...
3
4008
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 with a createElement function to add additional entries. The table has the first row of input text boxes already in it. You have to click a button to add another row. That seems to be working fine. How do I pull the information from the input boxes...
7
77833
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 boxes on the prior form. Not sure how to reference those text boxes in the dot notation used in VBA. I tried to use the Me.Refresh but that is not working. Is the Me. used to indicate the current working form?
1
1924
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 Select Box 1
4
2300
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 input mask of 'short date' format. The problem is that when I enter anything in these text boxes, as soon as the field looses focus, the text is cleared out - thus the text box is left blank. I have a button on the form that calls the requery...
0
9343
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9047
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5967
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
4477
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
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
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
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.