Access 97 RecordsetClone not working for Date 
Author Message
 Access 97 RecordsetClone not working for Date

Hi All

I am trying to clone a previous records field value that happens to be
a date.  I'm having a problem with the value of the date.  It's
returning a value of 1, (1/1/1900)  what am I missing?

Here is the code I'm using:

If Me.NewRecord Then
  Me.RecordsetClone.MoveLast
  Me!dtmHireDate.DefaultValue = Me.RecordsetClone!dtmHireDate
End If

TIA
Ann



Mon, 18 Feb 2002 03:00:00 GMT  
 Access 97 RecordsetClone not working for Date
The .DefaultValue property is actually a string - thus you need to put the
dtmHireDate inside two #

    Me!dtmHireDate.DefaultValue = "#" & Me.RecordsetClone!dtmHireDate & "#"

You may need to look at the usage of this though. The .DefaultValues will
only come into affect after the next time you add a new record. Any record
you add before this will be using the old .DefaultValue.

Mattias J?nsson


Quote:
> Hi All

> I am trying to clone a previous records field value that happens to be
> a date.  I'm having a problem with the value of the date.  It's
> returning a value of 1, (1/1/1900)  what am I missing?

> Here is the code I'm using:

> If Me.NewRecord Then
>   Me.RecordsetClone.MoveLast
>   Me!dtmHireDate.DefaultValue = Me.RecordsetClone!dtmHireDate
> End If

> TIA
> Ann



Tue, 19 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DLL usage - works in Access 97 but not in Access 2000

2. Help: CurrentDB and RecordSetClone crashing Access 97!

3. I want just the date, not the time!!-Access 97

4. VB expressions do not work properly in different installations of Access 97

5. Parameterized Update query not working correctly in Access 97

6. Access 97 - Application.Quit does not work if msgbox is displayed

7. DeleteObject not working with Access 97

8. Correlated subquery in DELETE stmt not work in Access '97 or 2000

9. ADO OLEDB will not work on Access 97

10. Visdata Grid not working with Access 97

11. LIKE Operator not working as with access 97

12. Microsoft.Jet.OLEDB.4.0 Provider not working with Access 97 MDB

 

 
Powered by phpBB® Forum Software