By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,462 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,462 IT Pros & Developers. It's quick & easy.

Troubles with date variable

P: 17
hello guys,

my goal is to open with doubleclick a record in a datasheet a form where i can see the records full page with more informations. so i dblclick on the field IDate and the form opens with the correct date and according informations in the record of this date.

the modul looks as follows:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Info_DblClick (Cancel as Integer)
  2.  
  3.     DoCmd.OpenForm "InfoForm" ,,, "[IDdate] =" & [IDdate]
  4.  
  5. End Sub
my problem is, the form is always empty.

when i use the [infoID] instead of [IDate], then i get the correct record to the field [infoID]. but i want to use the IDate.

what do i do wrong?
Jul 1 '15 #1

✓ answered by Seth Schrock

Date values need hashtags surrounding them. So your WhereCondition clause needs to be
Expand|Select|Wrap|Line Numbers
  1. "[IDdate] = #" & [IDdate] & "#"

Share this Question
Share on Google+
5 Replies


Seth Schrock
Expert 2.5K+
P: 2,951
Date values need hashtags surrounding them. So your WhereCondition clause needs to be
Expand|Select|Wrap|Line Numbers
  1. "[IDdate] = #" & [IDdate] & "#"
Jul 1 '15 #2

P: 17
thanks a lot! i had this idea already too, but with the wrong syntax! :)
Jul 1 '15 #3

NeoPa
Expert Mod 15k+
P: 31,768
Please check your questions carefully before posting. In various different parts of the thread you have referred to [IDate] & [IDdate]. It's very hard to work with unreliable information.
Jul 2 '15 #4

P: 17
Sorry won't happen again!
Jul 5 '15 #5

NeoPa
Expert Mod 15k+
P: 31,768
: - )
Jul 5 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.