Look up

J

Jerry P

I have a database with a group of numbers and I want to be
able to have a form or something that I put a number in
and it compares it with the numbers in the database and
tell me true or false or yes or no if the number match one
in the database....
Thanks for your help
Jerry
 
K

Ken Snell

Fairly easy to do.

Put a textbox on the form; you'll use the textbox to enter the number. Put a
command button on that formp; you'll use it to start the search.

In the OnClick event of the command button, you'll use code similar to this:

Private Sub cmdButtonName_Click()
If DCount("*", "TableName", "[FieldWithValue] = " & _
Me.txtBoxName.Value) = 0 Then
MsgBox "No Match Found"
Else
MsgBox "Match Found"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top