Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

testing values 1

Status
Not open for further replies.

raven39

Technical User
May 19, 2004
23
US
I have a form that the user inputs the version of software[unitcpu] <text field> in tblrepair, i need to test this against the current version of software[currentcpu] <text field> in tblcurrent. I have tried a multitude of different If statements and nothing is working correctly. I am moving on to SQL statements now.

THe end result i am looking for is when user inputs the [unitcpu] and moves to another field i want the [unitcpu] to test against the [currentcpu] and change the background color of the [unitcpu].

Is this possible? any help or point in correct directions is greatly appreciated

thanks
Raven

 
How are ya raven39 . . . . .

raven39 said:
[blue]when user inputs the [unitcpu] and moves to another field [purple]i want the [unitcpu] to test against the [currentcpu][/purple] and change the background color of the [unitcpu].[/blue]
Test the [blue][unitcpu][/blue] against the [blue][currentcpu][/blue] for what?

or

[blue]What is the criteria[/blue] for changing the color?

Calvin.gif
See Ya! . . . . . .
 
Raven

Yes, it is possible to test the entered data and control the process thereafter. As per AceMan, you need to tell us what you want to do.

In Access, you can use "Event Procedures". A few common event procedures include...
- AfterUpdate - when the end user enters data, such as CPU information, you can then check the entry vs an accepted standard. Hmmmm. Suppose you are supporting an application, and the end user reported that they have a Pentium II 233 MHz CPU, and your software needs a Pentium III 750 MHz minimum -- AfterUpdate could flag the field with a red back ground to alert the support person.
- OnCcurrent (record) - can check the current record and implement certain controls - hide fields, change colours, etc.
- BeforeUpdate (record) - verify data before writing it to the table.

There are two types of event procedures -- at the record level and at the field / control level.

Post with more info it you require more help
 
thanks aceman and will


What i want to test is the value the user types in unitcpu against the stored value in currentcpu.

The [unitcpu] = m110cpu2

the [currentcpu] = m140cpu2

the [unitcpu] needs updated to [currentcpu] version level. Hense, the [unitcpu] background color change to alert the user that this needs done.

Does this help in explaining?

Thanks
raven
 
A starting point in the AfterUpdate event procedure of unitcpu control:
If Me!unitcpu < DLookUp("currentcpu", "tblcurrent") Then
Me!unitcpu.BorderColor = RGB(255, 0, 0) 'Red
Me!unitcpu.ForeColor = RGB(255, 0, 0) 'Red
Me!unitcpu.BackColor = RGB(255, 255, 0) 'Yellow
Else
Me!unitcpu.BorderColor = RGB(0, 0, 0) 'Black
Me!unitcpu.ForeColor = RGB(0, 0, 0) 'Black
Me!unitcpu.BackColor = RGB(255, 255, 255) 'White
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
ok, PH now I have a question for ya... in your above example you used Me!unitcpu.ForeColor = RGB(255, 0, 0) 'Red
where I would have just used Me!unitcpu.ForeColor = 255 'red

what is the benifit of using yours?

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
what is the benifit of using yours
Always use a consistent way for color value.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PH, (I beleive that was a diplomatic way of saying no diffrence) Just always do it the same way so you dont confuse yourself.....

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
How are ya mustangcoupe . . . . .

[blue]RGB[/blue] is in fact the more [purple]Universal Standard[/purple] used thruout the programming world!

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top