On NoData, one of two msgboxes

Uvuriel03

Registered User.
Local time
Yesterday, 21:59
Joined
Mar 19, 2008
Messages
115
I've got a report that uses a user-entered parameter value to bring up a report on an OUTBOUND truck. It works just fine for outbound trucks--the thing is, the truck numbers vary between inbound and outbound, and there's no pattern to it.

What I would like to be able to do is this: On NoData, search for the entered truck number in the INBOUND list. If it is there, a msgbox would appear saying "This is an inbound truck." If it is not, that means it is in neither list (it would have to be in one or the other. If it's not in the inbounds, we already know it's not in the outbounds, so it must not exist yet), so then a msgbox would appear that says "This truck number does not exist!"

Unfortunately, I don't know how to do this.

And I'm learning SQL (slooooooowly), so it would be great if someone could help me out with the necessary code and maybe explain it a little!

Thanks guys! Really appreciate it!!
Rachel
 
are you familiar with DLookup?
on no data you could use that function to look for the truck and send the message. dlookup is quite simple. basically:
dlookup("value", "table or query etc", "value=n").

there's an extra little twist you can put on that code if no value is found. try the above first for a truck you know exists.
 
I tried using a macro for that, but for some reason it wasn't searching in the Inbound table. That's why I was hoping someone could help me with the SQL version. :rolleyes:
 
i have to go now. someone else will be along soon no doubt. they will probably need to know the table and field names you're after. or try to transcribe what you have in your macro and put it here for someone to see. or ... there's a tool to convert a macro to vba. if you do that you could copy the code you get into your next post. care to try some vba?
ciao for now.
 

Users who are viewing this thread

Back
Top Bottom