A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Iif in a Form



 
 
Thread Tools Display Modes
  #1  
Old February 1st, 2006, 04:23 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

Hello,

I'm a new user and trying to figure out how to get iif to work in a form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime' field in my
record. When I check off the 'Complete' box I want the current date (NOW())
and time to populate the 'Completetime' field automatically. I've looked over
this board on iif questions and haven't quite figured out the correct syntax.
Any help would be appreciated?

Thanks.
--
Rags
  #2  
Old February 1st, 2006, 05:02 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

"Rags" wrote in message
...
Hello,

I'm a new user and trying to figure out how to get iif to work in a form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime' field in
my
record. When I check off the 'Complete' box I want the current date
(NOW())
and time to populate the 'Completetime' field automatically. I've looked
over
this board on iif questions and haven't quite figured out the correct
syntax.
Any help would be appreciated?


I'd use a regular If, not an in-line one, in the check box's after update
event (untested):

If Me.chkMyCheckBox Then Me.txtMyTextField = Now()

Keith.
www.keithwilby.com


  #3  
Old February 1st, 2006, 06:25 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

Tried that and getting message about 'Macro or macro group doen't exist or
macro's new and hasn't been saved'. Do I need to create a macro for this?

Thanks.
--
Rags


"Keith Wilby" wrote:

"Rags" wrote in message
...
Hello,

I'm a new user and trying to figure out how to get iif to work in a form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime' field in
my
record. When I check off the 'Complete' box I want the current date
(NOW())
and time to populate the 'Completetime' field automatically. I've looked
over
this board on iif questions and haven't quite figured out the correct
syntax.
Any help would be appreciated?


I'd use a regular If, not an in-line one, in the check box's after update
event (untested):

If Me.chkMyCheckBox Then Me.txtMyTextField = Now()

Keith.
www.keithwilby.com



  #4  
Old February 1st, 2006, 09:01 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

You need to create an Event Procedure, and then type what Keith gave you
into that procedure.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Rags" wrote in message
...
Tried that and getting message about 'Macro or macro group doen't exist or
macro's new and hasn't been saved'. Do I need to create a macro for this?

Thanks.
--
Rags


"Keith Wilby" wrote:

"Rags" wrote in message
...
Hello,

I'm a new user and trying to figure out how to get iif to work in a

form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime'

field in
my
record. When I check off the 'Complete' box I want the current date
(NOW())
and time to populate the 'Completetime' field automatically. I've

looked
over
this board on iif questions and haven't quite figured out the correct
syntax.
Any help would be appreciated?


I'd use a regular If, not an in-line one, in the check box's after

update
event (untested):

If Me.chkMyCheckBox Then Me.txtMyTextField = Now()

Keith.
www.keithwilby.com





  #5  
Old February 2nd, 2006, 06:04 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

To keep things simple, you don't really need an iif statement. Try this
instead:

In the AfterUpdate event for the Complete check box, create an event
procedure with the following line of programming:

Me!CompleteTime = Now()

Note that this will update your CompleteTime field (I'm assuming it's a text
box) whenever there is any change to the Complete field check box (whether
it's turned on or off).

I hope this helps,

02.01.06 20.02 hst

"Rags" wrote:

Hello,

I'm a new user and trying to figure out how to get iif to work in a form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime' field in my
record. When I check off the 'Complete' box I want the current date (NOW())
and time to populate the 'Completetime' field automatically. I've looked over
this board on iif questions and haven't quite figured out the correct syntax.
Any help would be appreciated?

Thanks.
--
Rags

  #6  
Old February 3rd, 2006, 12:44 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Iif in a Form

I got it to work using iif within an event procedure on the checkbox click
module. Works fine. Erases it if you uncheck.

Thanks for all the help.
--
Rags


"UncleOli" wrote:

To keep things simple, you don't really need an iif statement. Try this
instead:

In the AfterUpdate event for the Complete check box, create an event
procedure with the following line of programming:

Me!CompleteTime = Now()

Note that this will update your CompleteTime field (I'm assuming it's a text
box) whenever there is any change to the Complete field check box (whether
it's turned on or off).

I hope this helps,

02.01.06 20.02 hst

"Rags" wrote:

Hello,

I'm a new user and trying to figure out how to get iif to work in a form.
I have a 'Complete' field (Yes/No) check box and a 'Completetime' field in my
record. When I check off the 'Complete' box I want the current date (NOW())
and time to populate the 'Completetime' field automatically. I've looked over
this board on iif questions and haven't quite figured out the correct syntax.
Any help would be appreciated?

Thanks.
--
Rags

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move feild entries from form to form using global variables JackCGW General Discussion 11 November 14th, 2005 05:22 AM
Tell if Form is a Dialog Alex Using Forms 7 August 30th, 2005 06:22 PM
Need Help In Printing Current Record in Specific Report RNUSZ@OKDPS Setting Up & Running Reports 1 May 16th, 2005 09:06 PM
Dates in a listbox connected to a form... RusCat Using Forms 13 November 25th, 2004 02:31 AM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM


All times are GMT +1. The time now is 03:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.