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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |