Need Help sending Msgbox if two variables are <>
Hello,
I need to compare two numbers from separate parts (different tables) of the DB. If the numbers are not equal, I need to send a Message box with a button in it to create new record in the one of the tables.
Here is the code I has so far...but it needs some work.
Private Sub Command152_Click()
On Error GoTo Command152_Click_Err
If State = "AZ" Then
DoCmd.OpenForm "AZ Fees & Costs" 'open Form
DoCmd.RunMacro "Find_on_click_TS2" 'search for a_ TS#\(ID#) and bring up the info
ElseIf "Form.AZ Fees & Costs.TS" <> "Macroload.Find_on_click_TS2" Then
MsgBox "No Fees & Costs Exist for this TS #" â(+ button that will create new record in Form.CA Fees & Costs.TS")
ElseIf State = "CA" Then
DoCmd.OpenForm "CA Fees & Costs" 'open Form
DoCmd.RunMacro "Find_on_click_TS2" 'search for a_ TS#\(ID#) and bring up the info
ElseIf "Form.CA Fees & Costs.TS" <> "Macroload.Find_on_click_TS2" Then
MsgBox "No Fees & Costs Exist for this TS # â(+ button that will create new record in Form.CA Fees & Costs.TS")
Else
MsgBox "State Unknown"
End If
Command152_Click_Exit:
Exit Sub
Command152_Click_Err:
MsgBox Error$
Resume Command152_Click_Exit
End Sub
Thank you in advance,
David92595
|