RePost Retriving data through form

K

K Crofts

Hi. I have added a command
button to my form which acts as a 'go' button for my
calender control. this has stabalised my database and i
only have one problem now. When i exit my database and
save the information to my form i am unable to recall the
information to the form from the table even though the
information has definately saved on the table. I have
added my code below, any ideas?

Private Sub GoButt_Click()
If IsNull(DFirst("Date", "Table content", "Date=#" & Format
(Me.Calendar2, "dd\/mmm\/yy") & "#")) Then
'no record. go to new record
Me.Date.SetFocus
DoCmd.GoToRecord , , acNewRec
'here moved line from above
Me.Date = Me.Calendar2.Value
Else
'position form on record with selected date
'Calendar2 used here:
Me.RecordsetClone.FindFirst "Date=#" & Me.Calendar2
& "#"
If Not Me.RecordsetClone.EOF Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End If
 
E

Eric Butts [MSFT]

Hi,

Most likely your problem is on the line

Me.RecordsetClone.FindFirst "Date=#" & Me.Calendar2 & "#"

Have you tried changing the fieldname "Date" to something like "fldDate".

Date is a keyword used by Microsoft Access.

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Content-Class: urn:content-classes:message
| From: "K Crofts" <[email protected]>
| Sender: "K Crofts" <[email protected]>
| Subject: RePost Retriving data through form
| Date: Sat, 24 Jul 2004 02:03:51 -0700
| Lines: 27
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| thread-index: AcRxXSOT8uSzNgyQQ4GNQxKyG4l2EQ==
| Newsgroups: microsoft.public.access.tablesdbdesign
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.tablesdbdesign:82133
| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| X-Tomcat-NG: microsoft.public.access.tablesdbdesign
|
| Hi. I have added a command
| button to my form which acts as a 'go' button for my
| calender control. this has stabalised my database and i
| only have one problem now. When i exit my database and
| save the information to my form i am unable to recall the
| information to the form from the table even though the
| information has definately saved on the table. I have
| added my code below, any ideas?
|
| Private Sub GoButt_Click()
| If IsNull(DFirst("Date", "Table content", "Date=#" & Format
| (Me.Calendar2, "dd\/mmm\/yy") & "#")) Then
| 'no record. go to new record
| Me.Date.SetFocus
| DoCmd.GoToRecord , , acNewRec
| 'here moved line from above
| Me.Date = Me.Calendar2.Value
| Else
| 'position form on record with selected date
| 'Calendar2 used here:
| Me.RecordsetClone.FindFirst "Date=#" & Me.Calendar2
| & "#"
| If Not Me.RecordsetClone.EOF Then
| Me.Bookmark = Me.RecordsetClone.Bookmark
| End If
| End If
|
|
 
K

K Crofts

Cheers Erik, works a treat.
-----Original Message-----
Hi,

Most likely your problem is on the line

Me.RecordsetClone.FindFirst "Date=#" & Me.Calendar2 & "#"

Have you tried changing the fieldname "Date" to something like "fldDate".

Date is a keyword used by Microsoft Access.

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03 -026.asp> and/or
to visit Windows Update at
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top