Validate

S

Sooner

I have a field set with a Data Type of Yes/No. I am using a combo box to to
check. If checked i would like the another field populated with todays date.
I have tried several ways to get this to populate unsuccessfully. I have
used the on update box as well as others to check for yes/no in field 1 to no
avail.

Any suggestions?

Thanks
 
M

Matt

Add VBA Code to the AfterUpdate Event of the Combo Box.

Private Sub YourCombobox_AfterUpdate()
If Me.YourCheckBox Then Me.YourDateField = Date
End Sub
 
S

Sooner

I was unable to get the code below to work, so it was suggested that I run
the following macro. It is in the afterupdate on the check box field

Item [Forms]![Notes Tracking]![Resolve Date]
Expression IIf([Forms]![Notes
Tracking]![Resolve]=No,Null,[Forms]![Notes Tracking]![Resolve Date]=[Date])

The following is the error I receive.

The object doesn't contain the Automation object 'Date'.
 
M

Matt

Try changing the Expression to:

IIf([Forms]![Notes > Tracking]![Resolve]=False,Null,[Forms]![Notes
Tracking]![Resolve Date]=Date())

--
-Matt
Microsoft Certified Professional


Sooner said:
I was unable to get the code below to work, so it was suggested that I run
the following macro. It is in the afterupdate on the check box field

Item [Forms]![Notes Tracking]![Resolve Date]
Expression IIf([Forms]![Notes
Tracking]![Resolve]=No,Null,[Forms]![Notes Tracking]![Resolve Date]=[Date])

The following is the error I receive.

The object doesn't contain the Automation object 'Date'.


Sooner said:
I have a field set with a Data Type of Yes/No. I am using a combo box to to
check. If checked i would like the another field populated with todays date.
I have tried several ways to get this to populate unsuccessfully. I have
used the on update box as well as others to check for yes/no in field 1 to no
avail.

Any suggestions?

Thanks
 
S

Sooner

Thanks

One last issue. The problem I am having now is that if I check the box for
resolve it will not populate the date. If I input a date with a check in the
field then remove the check to will null the date field.

Matt said:
Try changing the Expression to:

IIf([Forms]![Notes > Tracking]![Resolve]=False,Null,[Forms]![Notes
Tracking]![Resolve Date]=Date())

--
-Matt
Microsoft Certified Professional


Sooner said:
I was unable to get the code below to work, so it was suggested that I run
the following macro. It is in the afterupdate on the check box field

Item [Forms]![Notes Tracking]![Resolve Date]
Expression IIf([Forms]![Notes
Tracking]![Resolve]=No,Null,[Forms]![Notes Tracking]![Resolve Date]=[Date])

The following is the error I receive.

The object doesn't contain the Automation object 'Date'.


Sooner said:
I have a field set with a Data Type of Yes/No. I am using a combo box to to
check. If checked i would like the another field populated with todays date.
I have tried several ways to get this to populate unsuccessfully. I have
used the on update box as well as others to check for yes/no in field 1 to no
avail.

Any suggestions?

Thanks
 
M

Matt

You should be calling the Macro on the AfterUdate event of the checkbox.

--
-Matt
Microsoft Certified Professional


Sooner said:
Thanks

One last issue. The problem I am having now is that if I check the box for
resolve it will not populate the date. If I input a date with a check in the
field then remove the check to will null the date field.

Matt said:
Try changing the Expression to:

IIf([Forms]![Notes > Tracking]![Resolve]=False,Null,[Forms]![Notes
Tracking]![Resolve Date]=Date())

--
-Matt
Microsoft Certified Professional


Sooner said:
I was unable to get the code below to work, so it was suggested that I run
the following macro. It is in the afterupdate on the check box field

Item [Forms]![Notes Tracking]![Resolve Date]
Expression IIf([Forms]![Notes
Tracking]![Resolve]=No,Null,[Forms]![Notes Tracking]![Resolve Date]=[Date])

The following is the error I receive.

The object doesn't contain the Automation object 'Date'.


:

I have a field set with a Data Type of Yes/No. I am using a combo box to to
check. If checked i would like the another field populated with todays date.
I have tried several ways to get this to populate unsuccessfully. I have
used the on update box as well as others to check for yes/no in field 1 to no
avail.

Any suggestions?

Thanks
 
S

Sooner

That is where I am calling it.

The other thing that I get is if I put a date in and go back to that screen
it will be populated with a year of 1899. This will only happen the first
tme.

Matt said:
You should be calling the Macro on the AfterUdate event of the checkbox.

--
-Matt
Microsoft Certified Professional


Sooner said:
Thanks

One last issue. The problem I am having now is that if I check the box for
resolve it will not populate the date. If I input a date with a check in the
field then remove the check to will null the date field.

Matt said:
Try changing the Expression to:

IIf([Forms]![Notes > Tracking]![Resolve]=False,Null,[Forms]![Notes
Tracking]![Resolve Date]=Date())

--
-Matt
Microsoft Certified Professional


:

I was unable to get the code below to work, so it was suggested that I run
the following macro. It is in the afterupdate on the check box field

Item [Forms]![Notes Tracking]![Resolve Date]
Expression IIf([Forms]![Notes
Tracking]![Resolve]=No,Null,[Forms]![Notes Tracking]![Resolve Date]=[Date])

The following is the error I receive.

The object doesn't contain the Automation object 'Date'.


:

I have a field set with a Data Type of Yes/No. I am using a combo box to to
check. If checked i would like the another field populated with todays date.
I have tried several ways to get this to populate unsuccessfully. I have
used the on update box as well as others to check for yes/no in field 1 to no
avail.

Any suggestions?

Thanks
 
Top