AfterUpdate for Control

koolwaters

Active Member
Joined
May 16, 2007
Messages
403
I have a form capturing client information. There may be the rare occasion when an application for a client has been rejected for some reason. On the form, there is an application status combo box with Completed, Incomplete and Rejected as the values.

If the application status is complete, I want to open a pop-up form so that I can enter the reason the application has been rejected.

I have the following code in the AfterUpdate event of the combo box but it does not work. I have also played around with it for a few days but nothing is working.

Here is the code:

Code:
Private Sub cboApplicationStatus_AfterUpdate()
Dim stdocname As String
stdocname = "fpopRejectionReason"
    
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    If (Me.cboApplicationStatus = "Rejected") Then
    DoCmd.OpenForm stdocname, acNormal, , acFormAdd
End If
End Sub

I have added the Save line this morning to see if that is why it is not working. Basically, when I choose "Rejected" as the application status, the record is saved and the form does not open.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

koolwaters

Active Member
Joined
May 16, 2007
Messages
403
I got it to work. Finally!

Code:
Private Sub cboApplicationStatus_AfterUpdate()
Dim stdocname As String
stdocname = "fpopRejectionReason"
    
    If (Me.cboApplicationStatus.Column(1) = "Rejected") Then
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenForm stdocname, acNormal, , acFormAdd
    End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,132,679
Messages
5,654,714
Members
418,149
Latest member
tjanok

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top