473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shade textboxes of form based on checkbox

I must combine the information from two forms/tabs on a main form.

The idea is to insert two checkboxes on the main form.

Then based on the checkbox checked would then automatically highlight
those textboxes that need to be filled in by the end user.

Any advice on how best to do this?

Thanks!

Zuf
Jun 27 '08 #1
2 4442
On Jun 23, 9:23*pm, zufie <john.marru...@illinois.govwrote:
I must combine the information from two forms/tabs on a main form.

The idea is to insert two checkboxes on the main form.

Then based on the checkbox checked would then automatically highlight
those textboxes that need to be filled in by the end user.

Any advice on how best to do this?

Thanks!

Zuf
Hello,

Here is my idea - use Tag property of the text box field.

Assuming you have (for sample purpose here) 2 check boxes and several
text box fields, say 4. By clicking first check box it will add shadow
to first 2 text boxes and remove shadow from second 2 text boxes. Open
form in design view and select first 2 text boxes. In property Tag
write "Shadow1", for second 2 text boxes write "Shadow2" (without
quotes).

For first check box use this code:

Private Sub chkBox1_Click()
Dim ctl As Control

For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And chkBox1 = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Create similar code for second check box. 109 means text box
(acTextBox), 4 means "Shadowed", 1 means "Flat".

Use this idea to complete your form.

Regards,
Branislav Mihaljev
Microsoft Access MVP
Jun 27 '08 #2
Thanks Branislav,

The way I used your code I have all the textboxes resulting in being
shadowed when I click on checkbox 1 and resulting in being flat when
clicking on checkbox 2.

The textboxes that must be raised when either checkbox is checked are
almost the same.

How can I get some of the textboxes not to become shadowed?

Thanks,

Zuf
ban...@gmail.com wrote:
On Jun 23, 9:23�pm, zufie <john.marru...@illinois.govwrote:
I must combine the information from two forms/tabs on a main form.

The idea is to insert two checkboxes on the main form.

Then based on the checkbox checked would then automatically highlight
those textboxes that need to be filled in by the end user.

Any advice on how best to do this?

Thanks!

Zuf

Hello,

Here is my idea - use Tag property of the text box field.

Assuming you have (for sample purpose here) 2 check boxes and several
text box fields, say 4. By clicking first check box it will add shadow
to first 2 text boxes and remove shadow from second 2 text boxes. Open
form in design view and select first 2 text boxes. In property Tag
write "Shadow1", for second 2 text boxes write "Shadow2" (without
quotes).

For first check box use this code:

Private Sub chkBox1_Click()
Dim ctl As Control

For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And chkBox1 = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Create similar code for second check box. 109 means text box
(acTextBox), 4 means "Shadowed", 1 means "Flat".

Use this idea to complete your form.

Regards,
Branislav Mihaljev
Microsoft Access MVP
Jun 27 '08 #3

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

Similar topics

2
9726
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field in my asp form i use a checkbox and fot he other field i use a normal text box. if the yes/no field is checked then the other field is enabled...
2
3351
by: Mike N. | last post by:
I am looking to use an HTML checkbox feature as a trigger to shade/unshade a multiple select field in an HTML form. For instance: there are four options in the multiple select field and one outside of it. Is there a simple way, using JavaScript, so that if the outside option is selected, or "checked", the multiple select field will be shaded...
2
7581
by: Jason G | last post by:
** Any assistance you can provide would be greatly appreciated ** I have a main form with multiple sub-forms. On the main form, I have a checkbox that corresponds with each sub-form, and this checkbox will express the users desire to lock the ability to edit a corresponding sub-form. To do this, I figure that each checkbox will have : (1)...
11
3100
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together all the fields from two tables, each with about 20 fields. I then have a statistics form that has the query as its source and the form has 273...
3
3215
by: Mike | last post by:
Hi all Can't seem to find the answer I'm looking for and I tried just about everything I've read on here already. Maybe someone can help out. I need a list of medications to display and then allow the user to check off certain meds. Been having the usual problems. Based the form on a query to display the meds and had an unbound checkbox...
5
2052
by: FP | last post by:
I have a list of results. When the user clicks a checkbox I need it to update the database but I don't want it to reload the current page. Currently I have the following; - a checkbox in a form - the record ID as a hidden value in the form - using onclick to open a new window - form targets new window - new window closes itself Aside...
3
2228
by: Robert McEuen | last post by:
Using A2K3, Windows XP I'm handling a many-to-many relationship with a linking table structure as follows (irrelevant fields omitted): tblIssue PK_IssueID (autonumber, primary key) IssueName (text) tblArea
16
12037
by: Alexio | last post by:
Am new to javascript. I need to format the currency in the as numbers are entered in textboxes. I can format the currency in the calculations and display in the totals but can not figure out how to format in input textboxes. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>...
1
1810
by: tcertain | last post by:
I am totally duh at javascript although I have 2 books trying to learn it. I am trying to add values to a form and have a calculate total at end. this is my form script. I have hours at end of each radio or checkmark. (If this is checked, add these hours. ) I want to calculate total at the calculate button at the bottom of the form and...
0
7269
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
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...
1
7123
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...
0
7542
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...
0
5701
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...
0
4756
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...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
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
0
470
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...

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.