Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Capture

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
US
Can anyone tell me what the code below does not capture the date if a date exists in the field? I need to capture it so I can copy it into the next record. This same code will capture text and numbers, just not dates for some reason.


EstRecvdDate.SetFocus
If Not IsNull(EstRecvdDate) Then
dteEstRcvdDate = Me.EstRecvdDate
End If

Thanks!

Mary :eek:)
 
The field is probably something other than null. Try using this syntax

if Nz(EstRecvdDate,&quot;&quot;) <> &quot;&quot; then

This will catch if the field is null or a zero length string, neither of which you can see by looking at the field.
 
I still get nothing... no date if there is one, that is. Why can't I capture the date????

This is so weird.

Any clues??

Thanks!

Mary :eek:)
 
before your if statement put some debug code.

debug.print &quot;this is the date in Me.EstRecvdDate = &quot; ; Me.EstRecvdDate

after you run the statement then do a Control G it will show you what you have in the date field. Make sure you do in fact have a date in the field.

Jerry
 
Okay, I placed the code in and ran the procedure and then did the Control G... and yes, it does show the date. Then why am I losing it or not getting it copied into the date field????

I even checked the variable supposedly containing my date and IT is holding the date.

I really appreciate your help!

Thanks!

Mary :eek:)
 
I GOT IT JERRY!

I simply said if the variable was greater than 0, then populate the field. DUH!

If dteEstecvdDate > 0 Then
Me.EstRecvdDate = dteEstRcvdDate
End If



Thanks for all of your help!

Mary :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top