Hi,
I have created form and added text box and command buttons.
I want to cross check the data entered in textbox is valid or not from another table.
If entered data (request number) is there in table then command button is enabled otherwise it should give message "Request number is invalid.".
Please advice how I can write VBA code in form. I have try below VBA code but I got error.
Private Sub Text0_AfterUpdate()
If Me.Text0 = [ACT_Main_Table]![MDM request no] Then
Me.command1.SetFocus
Me.command2.SetFocus
Else
MsgBox " Please enter valid MDM request Number", vbCritical
End If
End Sub