Field value based on the combo box selection

Gd day,

In fact, there are two issues with the same logics behind. Hopefully, there will be no problem for Access Monsters:
Question 1:
There is a form based on the table. It has field [Due_Date] and it has field [Status]. Field [Status] is actually a combo box (2 colums: 1st p-key hidden; 2-nd text visible= "Outstanding" or "Closed".
Algorythm: If Combo is "Outstanding" then [Due_Date] can be whatever date or even empty.
If Combo is "Closed" then I want to be sure that the due date will be deleted automatically. Means, I need the field empty (not zero but empty). (people do forget to delete due date during closing of the case=> leading to closed case appears with due dates on the cumulative status etc.
Thanks in advance,

Question 2 is mostly similar:
Another table- another form. There is the same combo and 2 tick boxes.
Combo=" oustanding"=> [Tick1] and [Tick2] = whatever selected by the user
Combo="closed"=>[Tick1] and [Tick2]= not true

The code looks pretty simple. Dont understand why its not working.
Can split in two separate questions to award more points if necessary. Still dont understand where is the catch with these points (No time).
hotelguestAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kelvin SparksCommented:
Use the After update event of the combo

Use code similar to the following

If Me.Status = Closed(replace with ID for closed" Then
     Me.DueDate = NULL
End If

Similarly for the second
If Me.Status = ClosedThen
   me.tick1 = False
End If

Kelvin
0
ArgentiCommented:
Please follow these steps:

1. Open your form in Design mode
2. Click on the Status combobox
3. Go to Properties and select Events tab
4. Pick the AfterUpdate event, and click the "..." button on the right
This will open the VBS editor in order to create an event handler for your component after its value has changed

5. Write the following code
Private Sub StatusCombo_AfterUpdate()
    If Me.StatusCombo.Value = 2 Then
        Me.DateField.Value = Null
End Sub

Open in new window


Note: I suppose your Status combo has another name than StatusCombo. Same thing with DateField. Please modify them in the code
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.