Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 9th, 2006, 09:35 PM
sparks
Guest
 
Posts: n/a
Default compare a date field on form

I am trying to find valid records in a table
but I must compare a date field to a date stored in the table

I can see where this is wrong (ok I guess its not text)

"[date]= """ & Me.date & """"

so how do you format for a date comparison of a date field in a table
and compared to a text box with a date format?

is it something like


"[date]= """ & "#" & Me.date &"#" & """"
  #2  
Old October 9th, 2006, 10:55 PM
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default Re: compare a date field on form


sparks wrote:
Quote:
I am trying to find valid records in a table
but I must compare a date field to a date stored in the table
>
I can see where this is wrong (ok I guess its not text)
>
"[date]= """ & Me.date & """"
>
so how do you format for a date comparison of a date field in a table
and compared to a text box with a date format?
>
is it something like
>
>
"[date]= """ & "#" & Me.date &"#" & """"
If you remove all the quotes you should be fine.
"[SomeDate]=" & Forms![MyOpenForm]![txtDateFieldOnForm]

or you could include the # signs, but I don't think you need to
"[SomeDate]=#" & Forms![MyOpenForm]![txtDateFieldOnForm] & "#"

  #3  
Old October 10th, 2006, 12:45 PM
sparks
Guest
 
Posts: n/a
Default Re: compare a date field on form

Ok I rewrote the variables and tried it without dates

but when I do something like this in code
rs.FindFirst "[Teacher] = """ & Me.TeacherName & """" & "[date]= " &
Me.date & "[formsname]= """ & Me.FormsName & """"

I get object not supported by this type of object

so I changed it to

rs.FindFirst "[Teacher] = """ & Me.TeacherName & """" & "[date]= """ &
"#" & Me.date & "#" & """" & "[formsname]= """ & Me.FormsName & """"

same error

so last but not least I tried
rs.FindFirst "[Teacher] = """ & Me.TeacherName & """" & "[Date]=#" &
Forms![formpamcriss]![date] & "#" & "[formsname]= """ & Me.FormsName &
""""
same thing again

I can't seem to get this to work no matter what

Is this the arcane way to find a match with multible criteria?


On 9 Oct 2006 15:11:50 -0700, pietlinden@hotmail.com wrote:
Quote:
>
>sparks wrote:
Quote:
>I am trying to find valid records in a table
>but I must compare a date field to a date stored in the table
>>
>I can see where this is wrong (ok I guess its not text)
>>
>"[date]= """ & Me.date & """"
>>
>so how do you format for a date comparison of a date field in a table
>and compared to a text box with a date format?
>>
>is it something like
>>
>>
>"[date]= """ & "#" & Me.date &"#" & """"
>
>If you remove all the quotes you should be fine.
>"[SomeDate]=" & Forms![MyOpenForm]![txtDateFieldOnForm]
>
>or you could include the # signs, but I don't think you need to
>"[SomeDate]=#" & Forms![MyOpenForm]![txtDateFieldOnForm] & "#"
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles