Search Box

  • Thread starter Thread starter Joel
  • Start date Start date
J

Joel

To whom can help with my problem

I want to place a form in my database that will have the
text boxes on it. Text box 1 (Surname) Text box 2
(PostCode)

I want to create a searcbox that when you type in either
of those boxes you get a list of corrisponding details,
you then click on it and it opens that record.

How do you do that step by step

Regards Joel
 
Create your form. Set the form to Continuous Forms view.

Put the two textboxes on it in the form's Header section. Also put a command
button in the heade section.

Bind the form to a query that will return the desired records. For the two
fields that are to be filtered based on the textboxes, put criterion
expressions similar to this for each:
[Forms]![MySearchFormName]![TextBoxName1] Or
[Forms]![MySearchFormName]![TextBoxName1] Is Null

Code the OnClick event of the command button with code similar to this:
Private Sub CommandButtonName_Click()
Me.Requery
End Sub

In the Detail section of the form, add controls that are bound to the fields
in the form's recordsource. Also put a command button with the controls;
this button will be used to open a second form that will display the desired
info. On this button's OnClick event, put code similar to this:
Private Sub CommandButtonOpenRecord_Click()
' Use this line if Primary Key field is numeric
DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]=" & _
Me.ControlNameBoundToPrimaryKeyField
' Use this line if Primary Key field is text
' DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]='" & _
Me.ControlNameBoundToPrimaryKeyField _
& "'"
 
How do you bind a query to a form not sure what you mean
-----Original Message-----
Create your form. Set the form to Continuous Forms view.

Put the two textboxes on it in the form's Header section. Also put a command
button in the heade section.

Bind the form to a query that will return the desired records. For the two
fields that are to be filtered based on the textboxes, put criterion
expressions similar to this for each:
[Forms]![MySearchFormName]![TextBoxName1] Or
[Forms]![MySearchFormName]![TextBoxName1] Is Null

Code the OnClick event of the command button with code similar to this:
Private Sub CommandButtonName_Click()
Me.Requery
End Sub

In the Detail section of the form, add controls that are bound to the fields
in the form's recordsource. Also put a command button with the controls;
this button will be used to open a second form that will display the desired
info. On this button's OnClick event, put code similar to this:
Private Sub CommandButtonOpenRecord_Click()
' Use this line if Primary Key field is numeric
DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]=" & _
Me.ControlNameBoundToPrimaryKeyField
' Use this line if Primary Key field is text
' DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]='" & _
Me.ControlNameBoundToPrimaryKeyField _
& "'"


--

Ken Snell
<MS ACCESS MVP>

To whom can help with my problem

I want to place a form in my database that will have the
text boxes on it. Text box 1 (Surname) Text box 2
(PostCode)

I want to create a searcbox that when you type in either
of those boxes you get a list of corrisponding details,
you then click on it and it opens that record.

How do you do that step by step

Regards Joel


.
 
Open the form in design view. Open the Properties dialog box (icon on
toolbar). Click on Data. Go to Record Source. Select the query from the drop
down list (assuming that you have stored the query).

--

Ken Snell
<MS ACCESS MVP>

How do you bind a query to a form not sure what you mean
-----Original Message-----
Create your form. Set the form to Continuous Forms view.

Put the two textboxes on it in the form's Header section. Also put a command
button in the heade section.

Bind the form to a query that will return the desired records. For the two
fields that are to be filtered based on the textboxes, put criterion
expressions similar to this for each:
[Forms]![MySearchFormName]![TextBoxName1] Or
[Forms]![MySearchFormName]![TextBoxName1] Is Null

Code the OnClick event of the command button with code similar to this:
Private Sub CommandButtonName_Click()
Me.Requery
End Sub

In the Detail section of the form, add controls that are bound to the fields
in the form's recordsource. Also put a command button with the controls;
this button will be used to open a second form that will display the desired
info. On this button's OnClick event, put code similar to this:
Private Sub CommandButtonOpenRecord_Click()
' Use this line if Primary Key field is numeric
DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]=" & _
Me.ControlNameBoundToPrimaryKeyField
' Use this line if Primary Key field is text
' DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]='" & _
Me.ControlNameBoundToPrimaryKeyField _
& "'"


--

Ken Snell
<MS ACCESS MVP>

To whom can help with my problem

I want to place a form in my database that will have the
text boxes on it. Text box 1 (Surname) Text box 2
(PostCode)

I want to create a searcbox that when you type in either
of those boxes you get a list of corrisponding details,
you then click on it and it opens that record.

How do you do that step by step

Regards Joel


.
 
First of all I would lie to thank you for you in valuble
tech advice it has been exceptional. If I knew you I
would buy you more than a drink

I am sorry if I am pestering you that is not my mission
my mission is to soke up what you teach me.

I have done what you told me and there is a bit I am
unclear on. I have Done all the stugff in the header but.
It is when you get down to putting Bound controls in the
detail I am not sure of

Please help

Joel
-----Original Message-----
Open the form in design view. Open the Properties dialog box (icon on
toolbar). Click on Data. Go to Record Source. Select the query from the drop
down list (assuming that you have stored the query).

--

Ken Snell
<MS ACCESS MVP>

How do you bind a query to a form not sure what you mean
-----Original Message-----
Create your form. Set the form to Continuous Forms view.

Put the two textboxes on it in the form's Header section. Also put a command
button in the heade section.

Bind the form to a query that will return the desired records. For the two
fields that are to be filtered based on the textboxes, put criterion
expressions similar to this for each:
[Forms]![MySearchFormName]![TextBoxName1] Or
[Forms]![MySearchFormName]![TextBoxName1] Is Null

Code the OnClick event of the command button with code similar to this:
Private Sub CommandButtonName_Click()
Me.Requery
End Sub

In the Detail section of the form, add controls that
are
bound to the fields
in the form's recordsource. Also put a command button with the controls;
this button will be used to open a second form that
will
display the desired
info. On this button's OnClick event, put code similar to this:
Private Sub CommandButtonOpenRecord_Click()
' Use this line if Primary Key field is numeric
DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]=" & _
Me.ControlNameBoundToPrimaryKeyField
' Use this line if Primary Key field is text
' DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]='" & _
Me.ControlNameBoundToPrimaryKeyField _
& "'"


--

Ken Snell
<MS ACCESS MVP>

To whom can help with my problem

I want to place a form in my database that will have the
text boxes on it. Text box 1 (Surname) Text box 2
(PostCode)

I want to create a searcbox that when you type in either
of those boxes you get a list of corrisponding details,
you then click on it and it opens that record.

How do you do that step by step

Regards Joel


.


.
 
Do this after you've bound the form to a query.

Open the form in design view. Click on the Field List icon (toolbar). Select
and drag the fields from the list onto the Detail section of the form.

This is the easy way to get bound controls on the form. You then can move
them and change them and such.

--

Ken Snell
<MS ACCESS MVP>

First of all I would lie to thank you for you in valuble
tech advice it has been exceptional. If I knew you I
would buy you more than a drink

I am sorry if I am pestering you that is not my mission
my mission is to soke up what you teach me.

I have done what you told me and there is a bit I am
unclear on. I have Done all the stugff in the header but.
It is when you get down to putting Bound controls in the
detail I am not sure of

Please help

Joel
-----Original Message-----
Open the form in design view. Open the Properties dialog box (icon on
toolbar). Click on Data. Go to Record Source. Select the query from the drop
down list (assuming that you have stored the query).

--

Ken Snell
<MS ACCESS MVP>

How do you bind a query to a form not sure what you mean
-----Original Message-----
Create your form. Set the form to Continuous Forms view.

Put the two textboxes on it in the form's Header
section. Also put a command
button in the heade section.

Bind the form to a query that will return the desired
records. For the two
fields that are to be filtered based on the textboxes,
put criterion
expressions similar to this for each:
[Forms]![MySearchFormName]![TextBoxName1] Or
[Forms]![MySearchFormName]![TextBoxName1] Is Null

Code the OnClick event of the command button with code
similar to this:
Private Sub CommandButtonName_Click()
Me.Requery
End Sub

In the Detail section of the form, add controls that are
bound to the fields
in the form's recordsource. Also put a command button
with the controls;
this button will be used to open a second form that will
display the desired
info. On this button's OnClick event, put code similar
to this:
Private Sub CommandButtonOpenRecord_Click()
' Use this line if Primary Key field is numeric
DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]=" & _
Me.ControlNameBoundToPrimaryKeyField
' Use this line if Primary Key field is text
' DoCmd.OpenForm "NewFormName", , , _
"[PrimaryKeyFieldInQuery]='" & _
Me.ControlNameBoundToPrimaryKeyField _
& "'"


--

Ken Snell
<MS ACCESS MVP>

message
To whom can help with my problem

I want to place a form in my database that will have
the
text boxes on it. Text box 1 (Surname) Text box 2
(PostCode)

I want to create a searcbox that when you type in
either
of those boxes you get a list of corrisponding details,
you then click on it and it opens that record.

How do you do that step by step

Regards Joel


.


.
 
Back
Top