473,715 Members | 6,043 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 4447
On Jun 23, 9:23*pm, zufie <john.marru...@ illinois.govwro te:
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.SpecialEffe ct = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffe ct = 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.co m wrote:
On Jun 23, 9:23�pm, zufie <john.marru...@ illinois.govwro te:
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.SpecialEffe ct = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffe ct = 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
9742
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 otherwise it has to be disabled.Here's what i've done so far: Do While Not ObjRS.EOF <td><input...
2
3364
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 (unusable) and if it's deselected, or "unchecked", the multiple select field will be unshaded...
2
7604
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) the AfterUpdate property call a Macro or VB Module to execute the setting of the Allow Edits...
11
3135
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 textboxes on, each with a calculation based on the underlying query values. The form looks like a...
3
3228
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 but of course when one was checked all would check. Tried to add a boolean field to the query but...
5
2056
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 from the window flickering by this works well. The problem is
3
2242
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
12082
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> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html;...
1
1828
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 have a window that shows the total. please excuse the long form, but with all the different...
0
9196
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
9103
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,...
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...
1
6646
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
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
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2118
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.