473,387 Members | 1,485 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,387 software developers and data experts.

Pimary Key as date type, bug finding record

I'm new at access and i'm dealling with a simple problem on positioning the form record seeking a date primary field.

I have simple table with two data fields:
1- date field as short-date (primary field)
2 - description field as text

Every time i try to use a me.recordsetclone.findfirst to match a date starting with a zero (i.e 02-09-2006) it gives me nomatch but the record exists! If the date doesn't start with zero (i.e 20-09-2006) it matches the record.

How is this possible? Am i doing something wronge?

I retreive the dates from clicking in a listbox and it's rowsource is the date field from the table "MyDates"

The code i use is this:

Private Sub List0_Click()

With Me
.RecordsetClone.FindFirst "[MyDates] = #" & me.list0 & "#"
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
.Recordset.Bookmark = .RecordsetClone.Bookmark
Else
MsgBox ("Record not found")
End If
End With

End Sub

Thank you.

Note: i've tried "dlookup" method and it gives me the same results.
Sep 20 '06 #1
1 1394
MMcCarthy
14,534 Expert Mod 8TB
Although you see the date with a 0 this is a format not a value the value is only the 2 not the 02.

To find a date less than the 10th of the month use

Day([DateField])<10


I'm new at access and i'm dealling with a simple problem on positioning the form record seeking a date primary field.

I have simple table with two data fields:
1- date field as short-date (primary field)
2 - description field as text

Every time i try to use a me.recordsetclone.findfirst to match a date starting with a zero (i.e 02-09-2006) it gives me nomatch but the record exists! If the date doesn't start with zero (i.e 20-09-2006) it matches the record.

How is this possible? Am i doing something wronge?

I retreive the dates from clicking in a listbox and it's rowsource is the date field from the table "MyDates"

The code i use is this:

Private Sub List0_Click()

With Me
.RecordsetClone.FindFirst "[MyDates] = #" & me.list0 & "#"
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
.Recordset.Bookmark = .RecordsetClone.Bookmark
Else
MsgBox ("Record not found")
End If
End With

End Sub

Thank you.

Note: i've tried "dlookup" method and it gives me the same results.
Sep 21 '06 #2

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

Similar topics

5
by: Dominique Javet | last post by:
Hello, I'm new to php and mysql and I use Dreamweaver MX 2004, so sorry for this "newbie" question... I've found no answer in the forum ... I've a date problem with my formular. In my mysql DB...
2
by: rivka.howley | last post by:
I wrote some code that creates a table with a date/time field at 15-minute intervals. Here's how I create and populate the table With tblDataTemp ..Fields.Append .CreateField("CT_ID", dbLong)...
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
1
by: colleen1980 | last post by:
I create two fields in my old table. One is D_Status of type Yes/No Checkbox and the other is DDate of type Date. In my table there is already records in it. I set the default value of DDate as...
0
by: oneplace | last post by:
I have the following script that use for the following after i have made my search for a name in my database. I select the name and it bring up this from with all the information of the person. It...
2
by: dympna | last post by:
Hi can anyone suggest a fix for this... as I am a novice in access. I have created a training table with the following fields Employee Name - joe Training Received - Fork lift Date Received...
1
by: Thorben Grosser | last post by:
Hey again newsgroup, I am still working on an archive database and got another problem: I have to classify the folders by a date or a date range which has the format mm/yyyy I got the feeling,...
1
by: Presto | last post by:
I have two date fields. PaymentDate - is set to default to today : =Date() MeetingDate - is going to find the next meeting date after the PaymentDate So using April as an example: If...
6
by: MyWaterloo | last post by:
''''''''''''''''''''''''''''''''''''''''''' ' The AfterUpdate event procedure used in ' ' the Find Customer combo box search. ' ''''''''''''''''''''''''''''''''''''''''''' 'Moves to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.