473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

time field

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
6 1772
"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

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
"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

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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael Bulatovich | last post by:
I have a very simple db I use for keeping track of hours, tasks, projects, clients etc. It has a form that I use to enter data. Currently the form has a textbox for a field called "start time",...
4
by: Mark Reed | last post by:
Hi all, I have a query (query1) which shows scan date, scan time & operator. One scan = 1 record. What I want to do is create a report based on query 2 from query1 which shows all the scans AND...
3
by: Chanchito | last post by:
hi there, I am seeking some guidance in regards to creating a query. I would like to be able to have the query display records that have had a certain amount of time pass since the time that is...
4
by: luscus | last post by:
I am trying to device a formula so that when i check of a yes/no box (done) it will automatically add the time in a field called "End Time" and at the same time stamp the amount of minutes...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
5
by: rs | last post by:
I have a table with a timestamp field which contains the date and time. ie. 9/13/2004 9:10:00 AM. I would like to split this field into 2 fields, one with just the DATE portion ie 9/13/2004 and...
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
3
by: colleen1980 | last post by:
Hi: Data in my table is in that format. How to i separate date with time. 11/9/2006 10:10:46 AM Thank You.
3
by: tdes42 | last post by:
I believe I am looking for some form of Join Query, but my understanding of Access logic and my logic do not yet click entirely…. I have a table of ocean buoy data, taken every hour over many...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.