VBA and the "like" statement

SteelersFan

Registered User.
Local time
Today, 16:40
Joined
Feb 9, 2005
Messages
38
I'm a beginner to VBA but want to have a statement in a form that will flag a message when the value of two fields = x and y (on before update event)


If Me.Location.Value Like [location 1] = True and me.testdesc.value = "test1" Then

MsgBox ("Your Test and Location are not correct!!!")




Why doesn't this work
 
I am not sure what you are trying do do here, can you explain the logic please

Peter
 
SteelersFan said:
If Me.Location.Value Like [location 1] = True

Where's your wildcard if you are using the Like operator?

Also, what's with [Location 1]? That reeks of potential design issues!
 
You reek with sarcasim. I see you hovering over this little bb waiting to pounce on anyone who asks a question that is not worded to your liking.

Location 1 is an example only.

"where is my wildcard" is a good start to helping me out.



Dave in Philadelphia, Pa
 
SteelersFan said:
I see you hovering over this little bb waiting to pounce on anyone who asks a question that is not worded to your liking.

Location 1 is an example only.

What am I supposed to think? If you post a problem it would be less problematic if people just posted the problem without making up these elaborate examples. The reason I though Location 1 was a potential disaster is that it, to me, implies that you have a Location 2 and maybe more locations which would be a repeating group and an indication that you need a new table.

It's not about wording it to my liking but wording the question to your problem appropriately. I remember somebody who posted a simple problem and I helped to which they replied they were having problems implementing it because they'd created an example of their problem rather than just post the actual thing.

"where is my wildcard" is a good start to helping me out.

Sometimes it's better to reply with questions. That's the sort of question that makes you slap your forehead and go of course! :D
 
Beginners don't always know how to ask the question. You don't seem to get that notion.

I've been following this board for awhile and you seem to get your kicks out of writing saracastic, condescending replys. People seem to have this strange personally change when the are 'talking' via the internet.

Question: Would you respond to a live person, face to face the same as your responses in your posts? I thought not.
 

Users who are viewing this thread

Back
Top Bottom