There is no criteria for the Dlookup() function.
Maybe try:
Code:
If IsNull(txtID) Then
MsgBox "Please enter Customer's ID"
Else
If DLookup("[ID]", "tblA", "[ID] = " & txtID) > 0 Then
MsgBox " Customer ID already exists" & vbcrlf & vbcrlf & "A duplicate record cannot be created"
End if
BTW, "ID" is not really a good (descriptive) field name. Especially if used in multiple tables. "ID" of what?? CustomerID?? VehicleID?? EmployeeID?? If you had 3 tables: Customer, Vehicle and Employees, all with a field named "ID", it is hard to keep track of what "ID" is being used..