Providing default values in user prompt (1 Viewer)

mik

Lost in a VBA Jungle
Local time
Tomorrow, 00:12
Joined
Nov 16, 2004
Messages
22
Hi, I want to provide the end user a default value when prompted as in most cases the user will be using the default.

SELECT Customer_Name, Customer_Start_Date
FROM Customer
Where Customer_Start_Date >= [Enter Start Date (dd/mm/yyyy)];

Will bring up a blank prompt for the user to enter the. Is there a way that the date prompt can be defaulted?
 

llkhoutx

Registered User.
Local time
Today, 08:12
Joined
Feb 26, 2001
Messages
4,018
Set a default if message prompt returns a Null.
 

mik

Lost in a VBA Jungle
Local time
Tomorrow, 00:12
Joined
Nov 16, 2004
Messages
22
Default Date is left blank

Thanks llkhoutx,

Good suggestion, all the user has to do is click OK

Got it working with the following syntax;

>=IIf([start date (dd/mm/yyyy)] Is Null,CDate('01/01/2000'),[start date (dd/mm/yyyy)]) And <=IIf([end date (dd/mm/yyyy)] Is Null,CDate('01/01/2010'),[end date (dd/mm/yyyy)])

(yes I know I could of used between)

If both prompts are clicked 'OK' without filling in, then it defaults to the range 1/1/00 thru 1/1/10
 

Users who are viewing this thread

Top Bottom