On my form, I have a combo box for a required field. Once the user populates the data they click a button which, if the required field is populated, will open another form. If the required field is not populated, I do not want to open the other form but instead want a msgbox to appear. Below is my code:
I believe the error lies in my If statement but I don't know where my mistake(s) are. Can someone please help me!
Code:
Private Sub SaveCustomerInfo_Button_Click()
If Me!cmbo_CorporateGovernance.selectedIndex = -1 Then
MsgBox "You must enter a value for the Corporate Governance"
Exit Sub
End If
DoCmd.Close acForm, "Frm_NewCustomerInfo"
DoCmd.OpenForm "NewFrm_qry_CusIns_GenBusSit_General", acNormal, "", "", , acNormal
End Sub
I believe the error lies in my If statement but I don't know where my mistake(s) are. Can someone please help me!