Search process

H

Humpy

Can any one help. I have a database of names and need to be able to find
individual names using a search command?

Any ideas
 
S

scubadiver

What I would do is have a text box referenced in a query so when you press a
command button it refreshes the records on the name you search for.

In the criteria of the name:

[forms]![form name]![textbox]

in the command button 'on click' event

me.requery
me.refresh
 
H

Humpy

Thanks for the info. Thats a little beyond me at this stage can you recommend
any further reading material?
 
S

scubadiver

How is your DB set up at the moment?

Humpy said:
Thanks for the info. Thats a little beyond me at this stage can you recommend
any further reading material?
 
S

scubadiver

If your form is continuous (ie you have a list of records) and is based on a
table, instead do the following.

(this may seem a lot but Access databases are a lot of work!)

1) Instead of using a table, create a query using the table as the source.
So you open a blank query, choose your table and drag the fields from the
table to the bottom half of the pane.

2) In the criteria row for your name field type the following

like [forms]![form name]![searchbox]

4) in the header of the form, insert a text box and call it 'searchbox'.

What you will need to do is use the query as the record source for the form.
Click on the black box in the top left corner. Click on the 'data' tab and
choose the query in the 'record source' box.

5) next to the text box in the form create a command button. When the wizard
comes up cancel.

7) right click on the button, choose properties and insert the cursor into
the 'on click' event. at the far right press the arrow and choose the event
procedure.

8) click on the '...' next to the arrow. When the visual basic window comes
up type the following between the sub statements

me.requery

when you type in a name and press the button all your records with that name
should appear.


:
 
H

Humpy

Thanks for that almost there one final question. When you mention the Text
box should the greyed out area be called 'Searchbox' or the actual white box?

:)

scubadiver said:
If your form is continuous (ie you have a list of records) and is based on a
table, instead do the following.

(this may seem a lot but Access databases are a lot of work!)

1) Instead of using a table, create a query using the table as the source.
So you open a blank query, choose your table and drag the fields from the
table to the bottom half of the pane.

2) In the criteria row for your name field type the following

like [forms]![form name]![searchbox]

4) in the header of the form, insert a text box and call it 'searchbox'.

What you will need to do is use the query as the record source for the form.
Click on the black box in the top left corner. Click on the 'data' tab and
choose the query in the 'record source' box.

5) next to the text box in the form create a command button. When the wizard
comes up cancel.

7) right click on the button, choose properties and insert the cursor into
the 'on click' event. at the far right press the arrow and choose the event
procedure.

8) click on the '...' next to the arrow. When the visual basic window comes
up type the following between the sub statements

me.requery

when you type in a name and press the button all your records with that name
should appear.


:


It a basic form derived from a table ie. Name, Address1, Address2 etc etc
 
S

scubadiver

the greyed out box is the label (which I delete)

right click on the text box, go to the 'other' tab and type 'searchbox' in
the first row (name)

Humpy said:
Thanks for that almost there one final question. When you mention the Text
box should the greyed out area be called 'Searchbox' or the actual white box?

:)

scubadiver said:
If your form is continuous (ie you have a list of records) and is based on a
table, instead do the following.

(this may seem a lot but Access databases are a lot of work!)

1) Instead of using a table, create a query using the table as the source.
So you open a blank query, choose your table and drag the fields from the
table to the bottom half of the pane.

2) In the criteria row for your name field type the following

like [forms]![form name]![searchbox]

4) in the header of the form, insert a text box and call it 'searchbox'.

What you will need to do is use the query as the record source for the form.
Click on the black box in the top left corner. Click on the 'data' tab and
choose the query in the 'record source' box.

5) next to the text box in the form create a command button. When the wizard
comes up cancel.

7) right click on the button, choose properties and insert the cursor into
the 'on click' event. at the far right press the arrow and choose the event
procedure.

8) click on the '...' next to the arrow. When the visual basic window comes
up type the following between the sub statements

me.requery

when you type in a name and press the button all your records with that name
should appear.


:


It a basic form derived from a table ie. Name, Address1, Address2 etc etc

:


How is your DB set up at the moment?

:

Thanks for the info. Thats a little beyond me at this stage can you recommend
any further reading material?

:

Can any one help. I have a database of names and need to be able to find
individual names using a search command?

Any ideas
 
S

scubadiver

I meant right click and choose properties then 'other'

Humpy said:
Thanks for that almost there one final question. When you mention the Text
box should the greyed out area be called 'Searchbox' or the actual white box?

:)

scubadiver said:
If your form is continuous (ie you have a list of records) and is based on a
table, instead do the following.

(this may seem a lot but Access databases are a lot of work!)

1) Instead of using a table, create a query using the table as the source.
So you open a blank query, choose your table and drag the fields from the
table to the bottom half of the pane.

2) In the criteria row for your name field type the following

like [forms]![form name]![searchbox]

4) in the header of the form, insert a text box and call it 'searchbox'.

What you will need to do is use the query as the record source for the form.
Click on the black box in the top left corner. Click on the 'data' tab and
choose the query in the 'record source' box.

5) next to the text box in the form create a command button. When the wizard
comes up cancel.

7) right click on the button, choose properties and insert the cursor into
the 'on click' event. at the far right press the arrow and choose the event
procedure.

8) click on the '...' next to the arrow. When the visual basic window comes
up type the following between the sub statements

me.requery

when you type in a name and press the button all your records with that name
should appear.


:


It a basic form derived from a table ie. Name, Address1, Address2 etc etc

:


How is your DB set up at the moment?

:

Thanks for the info. Thats a little beyond me at this stage can you recommend
any further reading material?

:

Can any one help. I have a database of names and need to be able to find
individual names using a search command?

Any ideas
 
Top