 |
|
 |
|
Next: hostoftheparty.co
|
| Author |
Message |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 1) Posted: Mon Dec 08, 2008 5:42 am
Post subject: Color Text Box Archived from groups: microsoft>public>access (more info?)
|
|
|
|
| I have a check box and a text box. How to I make it so when my check box is
checked (or=Yes), my text box is yellow? Thank you very much!
-Scott Channell
|
>> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 8
|
(Msg. 2) Posted: Mon Dec 08, 2008 2:49 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
hi Scott,
channell wrote:
> I have a check box and a text box. How to I make it so when my check box is
> checked (or=Yes), my text box is yellow? Thank you very much!
Use the after update event of your check box:
Private Sub CheckBox0_AfterUpdate()
If CheckBox0.Value Then
Text0.BackColor = RGB(255, 0, 255)
Else
Text0.BackColor = RGB(255, 255, 255)
End If
End Sub
mfG
--> stefan <-- >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 3) Posted: Mon Dec 08, 2008 2:49 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
This is what I have, but it is not displaying the color when it is checked:
What am I doing wrong?
Private Sub SUSPENSION_CHECK_AfterUpdate()
If SUSPENSION_CHECK = Yes Then
OCCURANCE_DATE.BackColor = RGB(255, 0, 255)
Else
OCCURANCE_DATE.BackColor = RGB(255, 255, 255)
End If
End Sub
Thanks again Stefan.
"Stefan Hoffmann" wrote:
> hi Scott,
>
> channell wrote:
> > I have a check box and a text box. How to I make it so when my check box is
> > checked (or=Yes), my text box is yellow? Thank you very much!
> Use the after update event of your check box:
>
> Private Sub CheckBox0_AfterUpdate()
>
> If CheckBox0.Value Then
> Text0.BackColor = RGB(255, 0, 255)
> Else
> Text0.BackColor = RGB(255, 255, 255)
> End If
>
> End Sub
>
>
>
> mfG
> --> stefan <--
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 8
|
(Msg. 4) Posted: Mon Dec 08, 2008 4:01 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
hi,
channell wrote:
> This is what I have, but it is not displaying the color when it is checked:
> What am I doing wrong?
Please compare my example and your piece of code line by line, then you
will find a difference in the If-condition...
mfG
--> stefan <-- >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 5) Posted: Mon Dec 08, 2008 4:01 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
I apologize for not posting that I also tried this, but I am still getting no
response from the text box. I appreciate you helping to look closer, as I
know very little about VBA Coding, and I am eager to learn it. Thanks again
Stefan.
Private Sub SUSPENSION_CHECK_AfterUpdate()
If SUSPENSION_CHECK.Value Then
[OCCURANCE DATE].BackColor = RGB(255, 0, 255)
Else
[OCCURANCE DATE].BackColor = RGB(255, 255, 255)
End If
End Sub
"Stefan Hoffmann" wrote:
> hi,
>
> channell wrote:
> > This is what I have, but it is not displaying the color when it is checked:
> > What am I doing wrong?
> Please compare my example and your piece of code line by line, then you
> will find a difference in the If-condition...
>
>
> mfG
> --> stefan <--
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 8
|
(Msg. 6) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
hi,
channell wrote:
> I apologize for not posting that I also tried this, but I am still getting no
> response from the text box.
Is the event assigned to the combo box? Open the property editor, select
your check box. Change to page events, In line of After Update must have
the value [Event Procedure].
mfG
--> stefan <-- >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 7) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
Yes, I have everything where it needs to be, and assigned to the right
checkbox... any other ideas as to why it may not be working? Thanks again!
"Stefan Hoffmann" wrote:
> hi,
>
> channell wrote:
> > I apologize for not posting that I also tried this, but I am still getting no
> > response from the text box.
> Is the event assigned to the combo box? Open the property editor, select
> your check box. Change to page events, In line of After Update must have
> the value [Event Procedure].
>
>
>
> mfG
> --> stefan <--
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 8) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
Here is where I am at- If I use the following code I have two problems:
Private Sub SUSPENSION_CHECK_AfterUpdate()
If [SUSPENSION CHECK].Value Then
[OCCURANCE DATE].BackColor = vbYellow
Else
[OCCURANCE DATE].BackColor = vbWhite
End If
End Sub
1. The all records are highlighted, not just the individual one that is
checked
and
2. If I close the form and open it back up, the fields are no longer
highlighted.
I need the record to stay colored for as long as the check box is marked,
and I only need an individual record marked, not every record. Please Help?
"Stefan Hoffmann" wrote:
> hi,
>
> channell wrote:
> > I apologize for not posting that I also tried this, but I am still getting no
> > response from the text box.
> Is the event assigned to the combo box? Open the property editor, select
> your check box. Change to page events, In line of After Update must have
> the value [Event Procedure].
>
>
>
> mfG
> --> stefan <--
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 4, 2008 Posts: 33
|
(Msg. 9) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
"channell" wrote in message
> Yes, I have everything where it needs to be, and assigned to the right
> checkbox... any other ideas as to why it may not be working? Thanks
> again!
If you're using Access 2007, it's worth verifying that VBA code is not
disabled. In that situation, make sure the database is in a trusted
location, as specified in the Trust Center. >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 5, 2008 Posts: 31
|
(Msg. 10) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
To start I would compile the code (Debug >> Compile) if you have not already
done so.
Just to be sure everything is clear I would give the controls different
names than the fields. For instance, chkSuspensionCheck is the check box
bound to the SuspensionCheck field; txtOccurrenceDate is the text box bound
to OccurrenceDate. That shouldn't matter in this case (I think there are
some cases where it does), but I find it makes the code easier to read.
The other thing I would try is adding Me. in front of control names:
If Me.chkSuspensionCheck Then
etc.
Value is the default property for a control. You can add it if you wish,
but it shouldn't be necessary. As I recall Stefan tends to specify the
default property, which is proably good practice, but I have to admit I tend
not to do that.
BTW, if SuspensionCheck is a yes/no field, the following are equivalent:
If Me.chkSuspensionCheck = True Then ...
If Me.chkSuspensionCheck Then ...
However, I don't think Yes works in place of True.
"channell" wrote in message
> Yes, I have everything where it needs to be, and assigned to the right
> checkbox... any other ideas as to why it may not be working? Thanks
> again!
>
> "Stefan Hoffmann" wrote:
>
>> hi,
>>
>> channell wrote:
>> > I apologize for not posting that I also tried this, but I am still
>> > getting no
>> > response from the text box.
>> Is the event assigned to the combo box? Open the property editor, select
>> your check box. Change to page events, In line of After Update must have
>> the value [Event Procedure].
>>
>>
>>
>> mfG
>> --> stefan <--
>> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 16
|
(Msg. 11) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
Use conditional formating.
In design view click on Suspension Check
Select Format: Conditional formatting... from the menu
In the dialog.
Change "Field Value is" to "Expression is"
Enter the following
[Suspension Check] = True
Click the Paint Bucket and Select the background color you want to use
Click OK
TEST.
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
channell wrote:
> Here is where I am at- If I use the following code I have two problems:
>
> Private Sub SUSPENSION_CHECK_AfterUpdate()
> If [SUSPENSION CHECK].Value Then
> [OCCURANCE DATE].BackColor = vbYellow
> Else
> [OCCURANCE DATE].BackColor = vbWhite
> End If
>
> End Sub
>
> 1. The all records are highlighted, not just the individual one that is
> checked
> and
> 2. If I close the form and open it back up, the fields are no longer
> highlighted.
>
> I need the record to stay colored for as long as the check box is marked,
> and I only need an individual record marked, not every record. Please Help?
>
> "Stefan Hoffmann" wrote:
>
>> hi,
>>
>> channell wrote:
>>> I apologize for not posting that I also tried this, but I am still getting no
>>> response from the text box.
>> Is the event assigned to the combo box? Open the property editor, select
>> your check box. Change to page events, In line of After Update must have
>> the value [Event Procedure].
>>
>>
>>
>> mfG
>> --> stefan <--
>> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 12) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
I'm on office 2003
"Dirk Goldgar" wrote:
> "channell" wrote in message
>
> > Yes, I have everything where it needs to be, and assigned to the right
> > checkbox... any other ideas as to why it may not be working? Thanks
> > again!
>
> If you're using Access 2007, it's worth verifying that VBA code is not
> disabled. In that situation, make sure the database is in a trusted
> location, as specified in the Trust Center.
>
> --
> Dirk Goldgar, MS Access MVP
> [URL="http://www.datagnostics.com"]www.datagnostics.com[/URL]
>
> (please reply to the newsgroup)
>
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 8, 2008 Posts: 10
|
(Msg. 13) Posted: Mon Dec 08, 2008 4:31 pm
Post subject: Re: Color Text Box Archived from groups: per prev. post (more info?)
|
|
|
THANKS A TON!!! Just what I needed! Ia m always glad to learn something
new. I have now applied this technique to several aspects in my database. I
greatly appreciate it.
-Scott Channell
"John Spencer" wrote:
> Use conditional formating.
>
> In design view click on Suspension Check
> Select Format: Conditional formatting... from the menu
> In the dialog.
> Change "Field Value is" to "Expression is"
> Enter the following
> [Suspension Check] = True
> Click the Paint Bucket and Select the background color you want to use
> Click OK
> TEST.
> John Spencer
> Access MVP 2002-2005, 2007-2008
> The Hilltop Institute
> University of Maryland Baltimore County
>
> channell wrote:
> > Here is where I am at- If I use the following code I have two problems:
> >
> > Private Sub SUSPENSION_CHECK_AfterUpdate()
> > If [SUSPENSION CHECK].Value Then
> > [OCCURANCE DATE].BackColor = vbYellow
> > Else
> > [OCCURANCE DATE].BackColor = vbWhite
> > End If
> >
> > End Sub
> >
> > 1. The all records are highlighted, not just the individual one that is
> > checked
> > and
> > 2. If I close the form and open it back up, the fields are no longer
> > highlighted.
> >
> > I need the record to stay colored for as long as the check box is marked,
> > and I only need an individual record marked, not every record. Please Help?
> >
> > "Stefan Hoffmann" wrote:
> >
> >> hi,
> >>
> >> channell wrote:
> >>> I apologize for not posting that I also tried this, but I am still getting no
> >>> response from the text box.
> >> Is the event assigned to the combo box? Open the property editor, select
> >> your check box. Change to page events, In line of After Update must have
> >> the value [Event Procedure].
> >>
> >>
> >>
> >> mfG
> >> --> stefan <--
> >>
> >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 9, 2008 Posts: 3
|
(Msg. 14) Posted: Tue Dec 09, 2008 8:04 pm
Post subject: Multiple checkboxes in one table Archived from groups: per prev. post (more info?)
|
|
|
I created a database to track my bills and in one table I have the following.
Bill - Text box
1st Payment - Text box
Paid1 - Checkbox
2nd Payment - Text box
Paid2 - Checkbox
I used conditional formating to change the 1st and 2nd payment text boxes green if the amount is less then or equal to 0 and red if its greater than 0.
The first line of the conditional formating is "Expression Is" and the value is "[paid1]=Yes" to change the 1st payment text box green again when the paid1 check box is checked.
This works for the 1st Payment text box, but when I use the same conditional formating for the 2nd Payment box and change the "Expression Is" line to reflect "[paid2]=Yes", the 2nd Payment text box doesn't change colors unless both the paid1 and paid2 check boxes are checked.
I need the 2nd payment to change colors without both checkboxes being checked because sometimes the bills only come out of my second check.
Hopefully this makes sense and any help fixing it is greatly appreciated.
Thanks
Kevin >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
External

Since: Dec 9, 2008 Posts: 3
|
(Msg. 15) Posted: Tue Dec 09, 2008 8:09 pm
Post subject: Multiple checkboxes in one table Archived from groups: per prev. post (more info?)
|
|
|
After further review, when checking the [paid1] checkbox, it turns both the 1st payment and 2nd payment text boxes green.
The [paid2] checkbox does absolutley nothing checked or unchecked >> Stay informed about: Color Text Box |
|
| Back to top |
|
 |  |
| Related Topics: | remove character from text - What would the VB code be to if i type the following text into txtbox1 'GHY1048573850001' i when i exit it i would like it to remove the first 3 character and last 4 character and dispay it it in txtBox2 So the text will look like '104857385' Thanks
Show in a lebel or text M^3 - I want in the report labels and texts as Post Scripts Cubic Meters as M^3. We can do in MS Excel. Is any way to use in Access
How to write text file - Hi, How to wrote a field (memo) content to a text file. Before write to text file I want to remove the <div> ,</div>. How to do that? SF
Want to change colors of text items in reports - In a database I have a field with a drop down box that has 3 possible text answers. When one of these answers is selected, I would like to have a different color for each answer in the report. Example: Priority code with a selection of 1, 2, 3. In the...
Error importing text file into Access - I keep getting this error message: The specification XML failed to validate against the schema. There is an error in the following line of XML document: |. Help! |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|