Verify compliance.

Pis7ftw

Registered User.
Local time
Today, 06:56
Joined
Aug 5, 2012
Messages
37
Coding question!

Form:
Combo1 Yes/No
Combo2 Yes/No/Not Applicable
Combo3 Yes/No
Combo 4 Yes/No Not Applicable

Textbox label "Compliance?"
Textbox ""

If any combobox = No then display "No" in vbRed in Textbox
If all comboboxes = Yes or NOt Applicable then display "Yes" in compcolor (predefined variable).

Code:
   'NON-COMPLIANCY
    
     If Me.Pain_IniPain = "No" Then
            Me.Text67 = "No"
            Me.Text67.ForeColor = vbRed
    End If

                'COMPLIANCY
    
         If Me.Pain_IniPain = "Yes" Then
            Me.Text67 = "Yes"
            Me.Text67.ForeColor = compcolor
    End If

                'NOT APPLICABLE = COMPLIANCY
                
        If Me.Pain_InterPain = "Not Applicable" Then
            Me.Text67 = "Yes"
            Me.Text67.ForeColor = compcolor
      End If

However the textbox doesn't update correctly when I click my "verify" button. It either stays "Yes" or "No" or "Not Applicable" based on the first selection.

Does this need to be a If/And/Else situation, and how do I code it to properly work?
 
What is "Me.Pain_IniPain".

Is the code in the buttons On Click event
 
Sorry, Pain_IniPain, etc are comboboxes, Text67 is the textbox and the code is in the buttons OnClick.
 
Pain_IniPain, etc are comboboxes
Pain_IniPain can only be one of the combo boxes.
Which one is it and is that the combo box that you have been changing before running the code.
 
It is only one combobox. It includes "yes" "no" and "not applicable" as selections. Along with multiple others. I want it set up so that if "no" is selected in ANY of the comboboxes then the text in the textbox comes up as No. But if ALL of the comboboxes have either "Yes" or "Not Applicable" selected. I want Yes to come up on the textbox.

Essentially I don't want Yes OR No in the textbox until I click the verify button.
 
That's exactly what I need. What is the attached code though so I can use it in my db? Is it a BeforeUpdate event or is it still under the BUttonClick event?
 
Its in the buttons On Click event. Take a look at it and post back if you have any questions. I'm off to bed now but I will follow up tomorrow evening.
 

Users who are viewing this thread

Back
Top Bottom