Gremlins in my form

shift2076

Registered User.
Local time
Today, 14:54
Joined
Feb 5, 2007
Messages
51
Hi all.

I have a form with two fields that modify one cell in my table. The two fields are date and time, the cell being date/time. The control source is the same for both, and the format is set to short date for the first and short time for the second. They both pull up the records just fine.

The problem occurs when I try to change either. If I change the date the time reverts back to 00:00. If I change the time the date reverts back to 1/1/1899. This is not coolio.

Is there anyway to exorcize the demons from my form or is it a lost cause?

Thank you all,
MJ
 
Here is the code that combines the two fields into one:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If (Me.txtTimeDown) <> 0 Then
If (Me.txtDateDown) <> 0 Then
Me.txtDateTimeDown = _
DateValue(Me.txtDateDown) + TimeValue(Me.txtTimeDown)
End If
End If
End Sub
 
Workaround

All is good. I kept the date/time filed in my table but just added two more fields for the form to work with, date and time obviously :). There might have been a more kosher way to deal, but this works for me.

Thank you all for checkin' in,
MJ
 

Users who are viewing this thread

Back
Top Bottom