R
Robert
I have one field in the table:
startdateandtime
I have 3 textboxes on the form:
txtstartdateandtime
txtstartdate
txtstarttime
txtstartdateandtime is bound to the table field and is not visible.
txtstartdate and txtstarttime are meant to make it easier for the user than
a single field would be.
On the AfterUpdate events of both txtstartdate and txtstarttime I use the
following:
Me.txtStartdateandtime = CDate(Nz(Me.txtStartdate, 0)) +
TimeValue(Nz(Me.txtStarttime, "00:00:00"))
Me.Repaint
to put the entered values into the bound field (and then into the table).
This works. But when I put the following in the OnCurrent event of the
form:
Me.txtStarttime = Format([Startdateandtime], "hh:nn ampm")
to set the table value in the form so the user can see it I get a
type-mismatch error later when the AfterUpdate event is fired.
How can I correct this?
Robert
startdateandtime
I have 3 textboxes on the form:
txtstartdateandtime
txtstartdate
txtstarttime
txtstartdateandtime is bound to the table field and is not visible.
txtstartdate and txtstarttime are meant to make it easier for the user than
a single field would be.
On the AfterUpdate events of both txtstartdate and txtstarttime I use the
following:
Me.txtStartdateandtime = CDate(Nz(Me.txtStartdate, 0)) +
TimeValue(Nz(Me.txtStarttime, "00:00:00"))
Me.Repaint
to put the entered values into the bound field (and then into the table).
This works. But when I put the following in the OnCurrent event of the
form:
Me.txtStarttime = Format([Startdateandtime], "hh:nn ampm")
to set the table value in the form so the user can see it I get a
type-mismatch error later when the AfterUpdate event is fired.
How can I correct this?
Robert