473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 &"#" & """"
Oct 9 '06 #1
2 3015

sparks wrote:
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] & "#"

Oct 9 '06 #2
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, pi********@hotmail.com wrote:
>
sparks wrote:
>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] & "#"
Oct 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: WroteForLuck | last post by:
I am trying to write a simple SQL statement which will take a string (startdate) in the format DDMMYYYY and compare it to a date stored in an Oracle database. My SQL is as follows: <% "select...
4
by: alexis | last post by:
Hi, In a form I have the curent date <input name="datetoday" type="hidden" value="<? echo date("d/m/Y"); ?>"> and <input type=text name="datebox" size=15> The date format is d/m/Y...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
9
by: Rich | last post by:
Thanks for the Help in my previous post. I've been working on this and it's almost what I want. I want to obtain the user's current age by comparing their date of birth (user inputs) to the...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
3
by: Peter | last post by:
ASP.NET 1.1, this is a Intranet application and runs only on IE. I have two webform text boxes which contain dates - starting date and ending date. The dates could be in any format. for...
3
by: gmazza via AccessMonster.com | last post by:
Hi there, I am trying to run a report using a parameter for where the user chooses a month from a combo box. Then on the report, I want it to compare the month to a date field and choose only...
4
by: jmarcrum | last post by:
Hi everyone!! I have a continuous form that allows users to select a record and chnage the DATE that the record is assigned to another DATE within the same year. The button is called "Change plan...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.