By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,557 Members | 1,406 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,557 IT Pros & Developers. It's quick & easy.

time field

P: n/a
hi all !
i have a time field in a form and its in 24 hour time.
i need to be able to bring up a message when the user does not enter
anything in this field.
i tried some code to test if the field is null but it didnt work for
some reason.
i entered the code in the "on exit" section of the "events" in the
properties of the form.
the code is below :

if me.Time = null then
docmd.open form "time warning"
end if

i know im doing something wrong ... just dont know what it is ??
thanks
brino

Nov 8 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"brino" <bd*************@yahoo.com.auwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
hi all !
i have a time field in a form and its in 24 hour time.
i need to be able to bring up a message when the user does not enter
anything in this field.
i tried some code to test if the field is null but it didnt work for
some reason.
i entered the code in the "on exit" section of the "events" in the
properties of the form.
the code is below :

if me.Time = null then
docmd.open form "time warning"
end if

i know im doing something wrong ... just dont know what it is ??
thanks
brino
Rename your control "txtTime" and try If IsNull(Me.txtTime) Then ...

"Time" is a reserved word in Access.

Regards,
Keith.
www.keithwilby.com
Nov 8 '06 #2

P: n/a

Keith Wilby wrote:
"brino" <bd*************@yahoo.com.auwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
hi all !
i have a time field in a form and its in 24 hour time.
i need to be able to bring up a message when the user does not enter
anything in this field.
i tried some code to test if the field is null but it didnt work for
some reason.
i entered the code in the "on exit" section of the "events" in the
properties of the form.
the code is below :

if me.Time = null then
docmd.open form "time warning"
end if

i know im doing something wrong ... just dont know what it is ??
thanks
brino

Rename your control "txtTime" and try If IsNull(Me.txtTime) Then ...

"Time" is a reserved word in Access.

Regards,
Keith.
www.keithwilby.com
thanks keith,

i tried this but it doesnt work
im trying something else
brino

Nov 9 '06 #3

P: n/a
"brino" <bd*************@yahoo.com.auwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>
>>
Rename your control "txtTime" and try If IsNull(Me.txtTime) Then ...

"Time" is a reserved word in Access.

Regards,
Keith.
www.keithwilby.com

thanks keith,

i tried this but it doesnt work
im trying something else
brino
The text box may not be null. Try testing for a zero-length string ("").

Keith.
Nov 9 '06 #4

P: n/a

Keith Wilby wrote:
"brino" <bd*************@yahoo.com.auwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>
Rename your control "txtTime" and try If IsNull(Me.txtTime) Then ...

"Time" is a reserved word in Access.

Regards,
Keith.
www.keithwilby.com
thanks keith,

i tried this but it doesnt work
im trying something else
brino

The text box may not be null. Try testing for a zero-length string ("").

Keith.
i have already tested it and it is null.
i used the validation rule in table design and it picked up the null
field.
the problem is my client is not happy with this as it brings up 3
message boxs about the null problem and he thinks the users will "freek
out" about this so he wants just one message box to come up.im at a bit
of a loss as to what to do about this issue?

thanks again
brino

Nov 9 '06 #5

P: n/a
Hi Brino,

Try something like this in the Unload-event of the form:

If ( IsNull (Me!ctlTime) ) Then
Cancel = TRUE
MsgBox "Please fill in Time"
ctlTime.SetFocus
EndIf
Success, HBinc.
brino schreef:
hi all !
i have a time field in a form and its in 24 hour time.
i need to be able to bring up a message when the user does not enter
anything in this field.
i tried some code to test if the field is null but it didnt work for
some reason.
i entered the code in the "on exit" section of the "events" in the
properties of the form.
the code is below :

if me.Time = null then
docmd.open form "time warning"
end if

i know im doing something wrong ... just dont know what it is ??
thanks
brino
Nov 9 '06 #6

P: n/a
"hbinc" <j.********@hccnet.nlwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi Brino,

Try something like this in the Unload-event of the form:

If ( IsNull (Me!ctlTime) ) Then
Cancel = TRUE
MsgBox "Please fill in Time"
ctlTime.SetFocus
EndIf

Thanks for jumping in there HBinc, I hadn't noticed which event the OP was
using. D'oh!
Nov 10 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.