Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am new to this group and reletavily new to VBA code and Userforms so please forgive my potential huge knowledge gaps... I am trying to ensure that if one particular combobox has a value i.e. 'Breach' in it, that before the form can be 'submitted' successfully another combobox has a value in it. I feel I maybe close with the code below (but I could be a million miles away as well!): I am attempting to use code like: 'check for DPA 1st Box If Trim(Me.DPA.Value) = "" Then Me.DPA.SetFocus MsgBox "Please enter whether DPA was successful or not", vbExclamation, "Not Quite Complete..." Exit Sub End If ' Check DPAIF Box If Trim(Me.DPA.Value) = "Breach" Or "Process Fail" Then If Trim(Me.DPAIFBox.Value) = "" Then Me.DPAIFBox.SetFocus MsgBox "Please select a reason why DPA was not completed successfully" Exit Sub End If I am getting the error message: "Compile Error: Block IF without End IF" If the first DPA combobox says "Yes" or "N/A" then it is not essntial that the DPAIFBox has a value. Hope all this makes sense. Help would be grately appreciated - and I apoloigise if I have not conformed to any forum etiquette :) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combobox list based on choice in previous combobox | Excel Programming | |||
Combobox list based on choice in previous combobox | Excel Programming | |||
Combobox items based on choice in previous combobox | Excel Programming | |||
Ensuring Correct Vin Number is entered | Excel Discussion (Misc queries) | |||
How can you enable a combobox to be "tabbed" or entered out of? | Excel Discussion (Misc queries) |