Searching for a record using two fields based on full/partial info

R

Rob M

Hi all,

I'm trying to set up a procedure that seems like it should be simple - but I
can't figure it out.

I have a table called demographics with separate columns for last name,
first name, birth date, address, etc. I have a search form with two text
boxes. I'm trying to create search capabilities based on last name and/or
first name, either with full or partial entries, using two text boxes. For
example, using the search form, I'd like to access John Smith's record
(displayed in a separate "Main" form) by typing in...

Textbox1 Textbox2
Smith John
Smith
Sm John
Smi Jo

....etc.

Does anyone have any suggestions on how to perform this? Or are there any
downloadable code excerpts available? I'm a noob muddling my way through
this...I would be grateful for any help.

Thank you,
Rob
 
J

John W. Vinson

Hi all,

I'm trying to set up a procedure that seems like it should be simple - but I
can't figure it out.

I have a table called demographics with separate columns for last name,
first name, birth date, address, etc. I have a search form with two text
boxes. I'm trying to create search capabilities based on last name and/or
first name, either with full or partial entries, using two text boxes. For
example, using the search form, I'd like to access John Smith's record
(displayed in a separate "Main" form) by typing in...

Textbox1 Textbox2
Smith John
Smith
Sm John
Smi Jo

...etc.

Does anyone have any suggestions on how to perform this? Or are there any
downloadable code excerpts available? I'm a noob muddling my way through
this...I would be grateful for any help.

Thank you,
Rob

Put a criterion on LastName of

LIKE [Forms]![Searchform]![Textbox1] & "*"

and on FirstName

LIKE [Forms]![Searchform]![Textbox2] & "*"
 
R

Rob M

Hi John,

Many thanks, this is what I needed!

Cheers,
Rob


John W. Vinson said:
Hi all,

I'm trying to set up a procedure that seems like it should be simple - but
I
can't figure it out.

I have a table called demographics with separate columns for last name,
first name, birth date, address, etc. I have a search form with two text
boxes. I'm trying to create search capabilities based on last name and/or
first name, either with full or partial entries, using two text boxes.
For
example, using the search form, I'd like to access John Smith's record
(displayed in a separate "Main" form) by typing in...

Textbox1 Textbox2
Smith John
Smith
Sm John
Smi Jo

...etc.

Does anyone have any suggestions on how to perform this? Or are there any
downloadable code excerpts available? I'm a noob muddling my way through
this...I would be grateful for any help.

Thank you,
Rob

Put a criterion on LastName of

LIKE [Forms]![Searchform]![Textbox1] & "*"

and on FirstName

LIKE [Forms]![Searchform]![Textbox2] & "*"
 

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