Viewing filtered records on a form

P

Paul Fenton

We have a table of Subjects with their Social Security #'s as the
identifier. Some of the SSAN's are identical to others but
differentiated by a 1 letter suffix. Example:

111111111
111111111A
111111111B
etc.

In the course of entering new subjects, we need to check to see if the
SSAN entered has any matches in the existing subjects. The user has
no way of knowing if it's there in any form at all... all he has is a
9 digit SSAN.

As he enters the data, I check to see if that number exists in the
table and if so, I need to show him all the records with that SSAN,
regardless of the suffix.

Using the docmd.openform, how do I open a form that shows all the
records with a matching SSAN?



Paul Fenton
PLG & Associates.
 
A

AlCamp

Paul,
You should be able to use the LIKE operator in the "Where" portion of the
OpenForm function. (use your own names)
[SSNo] Like [SSAN_YOU_ENTERED] & "*"
So, 1111111111 entered will find...
111111111
111111111A
111111111B
hth
Al Camp
 
A

Allen Browne

Try:
Dim strWhere As String
strWhere = "SSAN Like """ & Me.SSAN & "*"""
DoCmd.OpenForm, "MyOtherForm", WhereCondition:=strWhere
 

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

Similar Threads


Top