if then popup question

denileigh

Registered User.
Local time
Today, 03:12
Joined
Dec 9, 2003
Messages
212
I have a form that we use to enter our workorders (jobs) into the database. The bottom of the form runs a query and returns record information if a car has been in our facility before.

I would like to program it so that if the query does in fact find a previous record it pops up a window or message that says so.

Basically I need something like...

If the arrival date (and/or) item number is not null then popup a message that tells you the car has been here before.

Thanks!
 
What do you have at the bottom of the form that runs the query? A RecordCount > 0 indicates returned records.
 
message

if not isnull(trim(me.arrivaldate)) then
msgbox("This car has been here before.")
end if


me.arrivaldate is the name of the text field on the form
Hope this helps
 
I FINALLY have some more time to play with this.

Where should I put that control? In the form properties? In the departure date properties? I've tried several and can't seem to get it. No errors...just nothing.
 
What do you have at the bottom of the form that runs the query?
 
I have it setup so that when the car number field is populated in the main form the subform does a search for any records with that same car number and returns their data.

I added a count control also so basically I just need to popup a message or form is the count in the text box is >1.
 
Put your code in the Current event of the SubForm.
 
Well...now it's getting trickier....that WORKED! WOHOO!!!!! However, it pops up everytime I switch records. I only need it to run after I enter a car number on the main form when creating a new record and the query reloads....not every time the form loads. Sorry if I didn't realize that before.
 

Users who are viewing this thread

Back
Top Bottom