473,783 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Continuos form format

Ian
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work
on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes
but only works with number fields ( like 0 and -1) but I don't want a red 1
to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.
Nov 12 '05 #1
3 1421
Ian, I'd put a call to your function in either the On Current event or the
Before Update event.

I made up the following function, for a form with a checkoff field (Check2)
and a text field (Text0):

Public Sub test()
If [Check2] = -1 Then
Me!Text0.ForeCo lor = 255
Else
Me!Text0.ForeCo lor = 1
End If
End Sub

It works with my test form. It checks for a Yes (-1) in the Check2 field,
if it is -1, it sets the Text0 font color to red. If not, the color changes
to black.

HTH

Skip

"Ian" <ia********@ntl world.com> wrote in message
news:_8******** *********@newsf ep1-win.server.ntli .net...
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes but only works with number fields ( like 0 and -1) but I don't want a red 1 to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.

Nov 12 '05 #2
Try something like

; "Yes"[Blue]; "No"[Red]

(semicolon at beginning) on the format property

hth
Roberto
"Ian" <ia********@ntl world.com> escreveu na mensagem
news:_8******** *********@newsf ep1-win.server.ntli .net...
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes but only works with number fields ( like 0 and -1) but I don't want a red 1 to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.

Nov 12 '05 #3
Ian
Many Thanks
Nov 12 '05 #4

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

Similar topics

9
23678
by: Dwalker | last post by:
I just want to enter today's date in a text input box with the format mm/dd/yyyy when it receives focus. I've been playing around with this but just can't seem to get it to work. Any help would be appreciated. Doug
0
1189
by: Aravind | last post by:
Hi folks. I have a query, qryHistory, which has the following field: DaysOverdue: IIf(<Date(),DateDiff("d",,Nz(,Date())),0) I also have a form (continuos), frmHistory, which is based on qryHistory. frmHistory has a checkbox, chkReturn, which has the following code
1
5773
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each type of answer) in the report's detail section and then making the control appropriate for each question visible in the Format event of the detail section. Can this be simulated in a form? There's no Detail Format event for a form but can it be...
13
1955
by: Jose.M.Huerta | last post by:
I'm trying to display in a continuos form some *.jpg. I have a table with the file path, (a photo of a person). Display these photos in a single form is very easy, just using changing some properties at the "current" event. But if I do it in the same way in a continous form seems to be impossible, since all images of the form change at the same time. I need a different image for each register. ¿How can I do it?
8
3590
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly created form. I can still get to the properties of every item on the form using the drop-down box in...
2
2134
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. Using Safari,my first iteration the script works fine ( indicating that there are 33 form variables ). When trying another dropdown select value, the
2
59199
NeoPa
by: NeoPa | last post by:
CHAPTER 1 - TABLE OF CONTENTS (Including attached database) CHAPTER 2 - INTRODUCTION CHAPTER 3 - TABLE LAYOUT CHAPTER 4 - FORM LAYOUT CHAPTER 5 - FORM MODULE CHAPTER 6 - CODE DISCUSSION (FILTER CONTROLS) CHAPTER 7 - CODE DISCUSSION (THE REST) --------------------------------------------------------------------------------
0
1555
by: eighthman11 | last post by:
Access 2000. Sql Server I know this is going to sound crazy but I have a continuous form which is bound to a sql table with an ODBC connection. I filter the records in the Continous form based on the selection from the previous form. At first moving through the records using the scroll bar on the right was slow. I placed an option button on the continous form which filtered the data to only show records that had a
0
1049
by: Rick | last post by:
Hi Guys! I'm using report viewer instead crystal reports (VS2005), i have a report that sends me 5 pages, i want to display all content in one view (continuos pages), when i was using crystal it's crystal viewer has an option to show continuos pages, but i can't find a similar property in ms report viewer, how can i show continuos pages using ms report viewer? Regards
0
9643
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10315
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
10147
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
10083
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
9946
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
8968
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
7494
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
6737
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();...
1
4044
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

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.