AfterUpdate

Experts,

I have a Parent / subform setup
Parent: End User Details (I realize it is named incorrectly with spaces and no "frm" in front)
Sub: frmRating

After Update of txtSPRating:
I want to automatically update cboRiskLevel to "Low" if the user selects in the dropdown any option that has an "A" in it.

cboRiskLevel has row source: "High";"Medium";"Low";"TBD"

here is what I have and it does not work.  No errors though.

Private Sub txtSPRating_AfterUpdate()
        If Me.txtSPRating Like "*A*" Then 'this is really a combobox but named as "txt"
            Forms![End User Details].frmRating.Form.cboRiskLevel = "Low"
        End If

I also tried below thinking I did not have to refer to any parent / sub form:
Private Sub txtSPRating_AfterUpdate()
        If Me.txtSPRating Like "*A*" Then 'this is really a combobox but named as "txt"
            Me.cboRiskLevel = "Low"
        End If
pdvsaProject financeAsked:
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.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Try referring to the Column of the combo, and use Instr instead of LIKE:

If Instr(1, "A", Me.txtSPRating.Column(1)) > 0 Then
  '/ Found an A in the combo
End If
0
Jeffrey CoachmanMIS LiasonCommented:
<aside, no points wanted>

If you extend what LSM posted, you could have a combobox "Store" the letter, but "display" the text.

Then there would be no need for code at all...
In fact you would not even need to see the letter, ...you would simple select "Low", form the combobox, and the "A" would be stored behind the scenes...

You can post separate question on this technique at a later time...
0
pdvsaProject financeAuthor Commented:
I need a column(1) even if the row source is not a query...just "High";"Medium";"Low";"TBD"
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

pdvsaProject financeAuthor Commented:
btw:  I tried it but it did not update to "Low".

here is how I have it:
 If InStr(1, "A", Me.txtSPRating.Column(1)) > 0 Then
        'If Me.txtSPRating Like "*A*" Then
            'Forms![End User Details].frmRating.Form.cboRiskLevel = "Low"
            Me.cboRiskLevel = "Low"
        End If
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You might try this:

 If InStr(1, Me.txtSPRating.Column(1), "A") > 0 Then

Or use a different column:

 If InStr(1, Me.txtSPRating.Column(0), "A") > 0 Then
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
pdvsaProject financeAuthor Commented:
thank you.  It works now.
0
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.