473,406 Members | 2,847 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,406 software developers and data experts.

change control feature while browsing records

this will probably seem like a lame question but it is baffling me.

I want to change the features if a control on a single form, i.e. the text
color of a particular field if another check box is checked. in other words,
if the check box for a flagged customer is checked, I want the customers
name to be red...

If Me.Inactive = "True" Then
Me.Client.ForeColor = 255
End If

Problem is, I don't know where to put this. If I put it in the OnLoad,
OnCurrent, etc. events it works fine if I open the form to that record. How
can I get the form to check this each time the record is changed, i.e. if
the user is browsing through the records one at a time?
Oct 2 '06 #1
3 1402
Not to clear what your situation is, but here is something you can try
for the following scenario:

You have a form is single form view. The datasource of the form is
based on some table. The datasource (the table) contains a yes/no field
(a checkbox field) called "YesNo". You can add code like the following
the form's current event:

Private Sub Form_Current()
If Me.YesNo = True Then
fldx.ForeColor = VbRed
Else
fldx.ForeColor = VbBlack
End If
End Sub

You have to remember to change the color of the textbox back to the
original color if the yes/no condition is False.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 2 '06 #2
The Current event will fire when the user navigates to another record.
Plus, it fires twice during the Load sequence of the form. Your code
deserves to be in the Current event procedure; be sure to check the Nz()
values of your fields as to circumvent errors during the initial calls.

Jimmy Stewart schreef:
this will probably seem like a lame question but it is baffling me.

I want to change the features if a control on a single form, i.e. the text
color of a particular field if another check box is checked. in other words,
if the check box for a flagged customer is checked, I want the customers
name to be red...

If Me.Inactive = "True" Then
Me.Client.ForeColor = 255
End If

Problem is, I don't know where to put this. If I put it in the OnLoad,
OnCurrent, etc. events it works fine if I open the form to that record. How
can I get the form to check this each time the record is changed, i.e. if
the user is browsing through the records one at a time?

--
Bas Cost Budde
Holland
www.heuveltop.nl/BasCB/msac_index.html
Oct 2 '06 #3
Not really sure what was going on before, but I added your code to the
OnCurrent event and it works great. I must have had some syntax problems
with my code?

"Rich P" <rp*****@aol.comwrote in message
news:45***********************@news.qwest.net...
Not to clear what your situation is, but here is something you can try
for the following scenario:

You have a form is single form view. The datasource of the form is
based on some table. The datasource (the table) contains a yes/no field
(a checkbox field) called "YesNo". You can add code like the following
the form's current event:

Private Sub Form_Current()
If Me.YesNo = True Then
fldx.ForeColor = VbRed
Else
fldx.ForeColor = VbBlack
End If
End Sub

You have to remember to change the color of the textbox back to the
original color if the yes/no condition is False.

Rich

*** Sent via Developersdex http://www.developersdex.com ***

Oct 2 '06 #4

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

Similar topics

10
by: Paul Kooistra | last post by:
I need a tool to browse text files with a size of 10-20 Mb. These files have a fixed record length of 800 bytes (CR/LF), and containt records used to create printed pages by an external company. ...
4
by: Oscar | last post by:
I am quite new to the ASP scene. I want to display the results of a recordset into a third party grid control called VSFlexgrid. I've prepared one asp page which queries an Access database and...
3
by: Sam Gledhill | last post by:
Hi, I'm hoping someone can help me out. I have a database with a form. This form has no recordsource (I'm using it as a complex MsgBox). It has a single textbox of type Date. It also has three...
1
by: Mike Kansky | last post by:
Hello, does anybody here have any idea on how to implement the Co-Browsing feature, the same like LivePerson's?...
49
by: Atul Chaturvedi | last post by:
If we use ASP.NET 2.0 Login Control, we are unable to click on Login and Reset Buttons on Safari running on Apple Mac OS X Version 10.3.2 . How can i resolve the problem.
2
by: Lyle Fairfield | last post by:
I am using Microsoft’s Web Browser Control embedded on an Access Form to browse a specific site. I have a good reason for doing so; the pages on this site run code which aborts their display unless...
3
by: Ronald S. Cook | last post by:
I was told that if calling lots of records from the database (let's say 100,000), that the GridView's paging feature would automatically "handle" everything. But the 100,000 records are still...
8
by: mlwerth | last post by:
Dear Access Group: This is the most basic and most embarrassing of questions, but I cannot find where to change the data type of a text field that I have in Access 2003 to a number field. I've...
3
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RecordSource of a Master Report is: Me.RecordSource = "TableOrQueryName"
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: 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...
0
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,...
0
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...
0
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,...
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...
0
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,...
0
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...

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.