Opening a Form Withe Where Condition

JamesJoey

Registered User.
Local time
Today, 13:02
Joined
Dec 6, 2010
Messages
642
I'm trying to open a form with a date field from a command button. I'd like the form to open and display records where the date is less than Today()

Code:
DoCmd.OpenForm "frmReminders" , , , "ReminderDate" < Date
When I click the button the form opens showing no records even though I deliberately change a record's date to yesterday.

Thanks,
James
 
Try
Code:
"ReminderDate < Date"
 
I get the 'Enter Parameter Value' for 'Date.' Which isn't the name of a field on the frmReminders form.
 
I needed to add the () to Date.

"ReminderDate < Date()"

Works ok now.

Thanks,
james
 
I needed to add the () to Date.

"ReminderDate < Date()"

Works ok now.

Thanks,
james

I was just about to post that :D as effectively I believe it is the SQL statement without the WHERE?
In VBA I believe it would be Date.

I get them mixed up as well at times.
 
You're right.
I have several functions using date and () isn't required.
 
I constantly have to refer to previous code I have created to see how I did something.:D
 
I constantly have to refer to previous code I have created to see how I did something.:D

What is really distressing is when I go back and look at how I did something in the past, I ask myself “how did you figure this out?” Almost as much as I ask myself “WHAT the hell were you THINKING?!?!?
 
What is really distressing is when I go back and look at how I did something in the past, I ask myself “how did you figure this out?” Almost as much as I ask myself “WHAT the hell were you THINKING?!?!?

I always add lots of comments, for my benefit. :D
My memory is shot these days, but in my defence I am over 60. :confused:

And before anyone jumps in and says they have great recollection despite being over 60, I just wish I was like you guys.:D
 
And before anyone jumps in and says they have great recollection despite being over 60, I just wish I was like you guys.

Well, I can't even remember if that's true for me ....:rolleyes:
 

Users who are viewing this thread

Back
Top Bottom