Hi
Im using this to code to try and only get the form to open when the number is present in the account number fied in the data table but it's bringing back 0 every time, ie giving me the message "Account number not found".
Help please 😃
Private Sub Command0_Click()
DoCmd.SetWarnings False
If IsNull(Me.Number.Value) Or (Me.Number.Value) = "" Then
MsgBox "Please Enter Account Number"
Exit Sub
Else
End If
'If DCount("[Account_Number]", "Data", [Account_Number] = Me.Number) > 0 Then
DoCmd.OpenForm FormName:="Form1"
'Exit Sub
'Else
'End If
'MsgBox "Account Number not found"
'Exit Sub
DoCmd.SetWarnings True
End Sub