Populate Option Group when date field is entered (1 Viewer)

bdhtexas

Registered User.
Local time
Today, 02:00
Joined
Dec 3, 2003
Messages
79
I have a form where users fill in a date resolved and click complete in the Option Group, it's default value is incomplete. I have a problem with the users forgetting to change it to complete when the enter the date resolved. Is there a way to change the option group value when the date resolved is entered?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:00
Joined
Feb 19, 2002
Messages
43,396
If the resolved flag is totally dependent on the presence/absence of a resolved date? If it is, it is redundant and in violation of third normal form. You should remove the option group completely or make it unbound and locked and set it with code in the form's current event and the afterUpdate event of the resolved date.
 

bdhtexas

Registered User.
Local time
Today, 02:00
Joined
Dec 3, 2003
Messages
79
Pat Hartman said:
If the resolved flag is totally dependent on the presence/absence of a resolved date? If it is, it is redundant and in violation of third normal form. You should remove the option group completely or make it unbound and locked and set it with code in the form's current event and the afterUpdate event of the resolved date.

It is totally dependent, I will make the change, any idea what coding to use?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:00
Joined
Feb 19, 2002
Messages
43,396
If you make the option group unbound and locked, you can use the following code in both the Current event and the AfterUpdate event of the resolved date.
Code:
If IsDate(Me.ResolvedDt) Then
    Me.optResolved = 2   'resolved
Else
    Me.optResolved = 1   'incomplete
End If
 

bdhtexas

Registered User.
Local time
Today, 02:00
Joined
Dec 3, 2003
Messages
79
Great, thanks for your help

I will make the changes at work in the morning and let you know how it goes or if I have any problems, work is only 9 hours away now.
 

bdhtexas

Registered User.
Local time
Today, 02:00
Joined
Dec 3, 2003
Messages
79
IF I make this an unbound object will the data in this option group update the table? I need it to continue to enter it's value in the table.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:00
Joined
Feb 19, 2002
Messages
43,396
You don't need its value to be stored in the table. Any criteria that would select based on this field will work the same way against the date field.
 

Users who are viewing this thread

Top Bottom