here is a command button I used to make it.
-----------------
Private Sub Command0_Click()
'On Error GoTo Err_Command0_Click
Dim retval As Variant
retval = InputBox("Enter student ID", "Student ID", ""
Dim db As Database, rst As Recordset, SQL As String
Set db = CurrentDb
' SQL string.
SQL = "SELECT * FROM Students WHERE StudentID = '" & retval & "';"
Set rst = db.OpenRecordset(SQL)
If rst.RecordCount > 0 Then
MsgBox "Found Student " & rst!StudentID & " - " & rst!Name, vbInformation, "Found Student"
Else
MsgBox "Student ID " & retval & " Not found!!!", vbExclamation, "Missing student ID"
End If
rst.Close
db.Close
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
----------------------
DougP, MCP
dposton@universal1.com
Ask me how Bar-codes can help you be more productive.