Comparing two fields and output message

J

Javes

Hello,

One of the professionals helped me with a code below but
it doesn't seem to work...nothing shows up, all 3 fields
are unbound....I would like to know if someone has a code
for a field I want to compare: IF Textbox1 is EQUAL to
Textbox2 THAN Textbox3 will display Textbox1 Total OR IF
they are not equal THAN it will display a
message "UNBALANCED"

I suck at coding, I placed this code in the Event
BeforeUpdate and it doesn't give any errors but nothing
shows up:

If Me!Textbox1 = Me!textbox2 then
Me!Textbox3 = Me!Textbox1
Else
Me!Textbox3 = "Unbalanced"
End IF

Please HELP!!!!
Thanks for all that continue to support me.

Javes
 
H

hnq51834

the code is correct - you've got it in the wrong place

you can put the code in the AfterUpdate event for both text box1 and text box 2. This will cause the code to run everytime you change the value in either text box 1 or text box 2

hope this helps

-ha

----- Javes wrote: ----



Hello

One of the professionals helped me with a code below but
it doesn't seem to work...nothing shows up, all 3 fields
are unbound....I would like to know if someone has a code
for a field I want to compare: IF Textbox1 is EQUAL to
Textbox2 THAN Textbox3 will display Textbox1 Total OR IF
they are not equal THAN it will display a
message "UNBALANCED

I suck at coding, I placed this code in the Event
BeforeUpdate and it doesn't give any errors but nothing
shows up

If Me!Textbox1 = Me!textbox2 the
Me!Textbox3 = Me!Textbox
Els
Me!Textbox3 = "Unbalanced
End I

Please HELP!!!
Thanks for all that continue to support me

Jave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top