Query criteria option box

fyntan
09-29-2000, 04:46 PM
Hi
Can anyone recommend a way to avoid the 'soft-crash' that happens when using the 'Cancel' option on an InputBox. This InputBox is the one generated by using the criteria option in a query.
I have considered not using the query facility and just using my own InputBox but using the existing one seems a better and easier option.
Can I set the vbCancel in these boxes to return to the main menu somehow?

BillSoo
09-29-2000, 06:20 PM
I don't use that particular input box much but I imagine you could probably trap the error...

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

roger
10-04-2000, 01:10 PM
Hi,
What you can do is check for the return string from the inputbox, if it is 0 length or empty, return to orginal form or dont proceed with code.
Ex:
mystr = inputbox("enter name")
if mystr = "" then
exit sub
Else
msgbox mystr
endif

Note: if you hit cancel in input box, it return an empty string.

Hope this helps,

Good luck
Roger

"Great Ideas need Landing Gears as well as Wings"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum