Search and display multiple records

G

Guest

Hello All,

Is it possible to put a search bar on form that will find multiple records.
For example; find all the people who live in a city named Fremont. When I use
the binocular search in Access it only lists one record at a time. I would
like to see all the records that match a certain criterior.
 
S

SusanV

Hi Sky,

I would base the search results form on a query, using an input box. Try
putting something like this in the criteria field:

Like '*' & [Message you want to show in the popup box] & '*'

or if you prefer to do it via SQL view, the where part would be something
like:

WHERE (((TableName.FieldName) Like '*' & [Message you want to show in the
popup box] & '*'));
 
A

Albert D. Kallal

I usually make a main form, and then throw in a sub-form to "list" the hits.

In the mains form text box after update event, you can do:

dim strSql = "select * from tblCustomers where City like '" & txtCity & "*'"

me.myCoolSubForm.Form.RecordSouce = strSql

The above will give you a nice list. Here is some screen shots and some
ideas of the above code in action:

http://www.members.shaw.ca/AlbertKallal/Search/index.html
 
G

Guest

Susan, Albert,

I will try both your suggestions. I like the sub form idea too but I'm not
much of an expert on that yet. I think I'll buy a book on Access that can
show me how to do sub forms. Do either of you have a suggested reference you
can point me to?
 
G

Guest

Thank you Albert for your resource info re: Access. I shall look into them
right now. I had forgotten about looking over the Microsoft site for
information but you jogged my memory. Your alright with me dude. Now, if I
could just become as good at this as you and others I'd be a happy camper :)
 
G

Guest

Thanks Susan for your input on this. I need more practice with Access so I'll
know what to do with the answers I get back. I'll still try using what you
gave me though and see what happens. Many thanks though!

SusanV said:
Hi Sky,

I would base the search results form on a query, using an input box. Try
putting something like this in the criteria field:

Like '*' & [Message you want to show in the popup box] & '*'

or if you prefer to do it via SQL view, the where part would be something
like:

WHERE (((TableName.FieldName) Like '*' & [Message you want to show in the
popup box] & '*'));

--
hth,
SusanV


Sky Warren said:
Hello All,

Is it possible to put a search bar on form that will find multiple
records.
For example; find all the people who live in a city named Fremont. When I
use
the binocular search in Access it only lists one record at a time. I would
like to see all the records that match a certain criterior.
 
G

Guest

Hi Albert,

I currently required to do something as u showed as screen shots...
is had used the code below... but have an error as shown below:

Daily Report can’t find the macro ‘dim strSql = "select * from tblDaily
Report where Origin like '" & txtOrigin & "*'"

me.Daily Report1.Form.RecordSouce = strSql ’

The macro (or its macro group) doesn’t exist, or the macro is new but hasn’t
been saved.
Note that when you enter the macrogroupname.macroname syntax in an argument,
you must specify the name the macro’s macro group was last saved under.


Did i do anything wrong on it? Pls advice...
Sorry i not gd in SQL....

Thanks
Green
 
A

Alex White MCDBA MCSE

You are setting the value on the declaration line (cannot currently do in
vba) and does your table name have a space in it.

dim strSql = "select * from tblDaily Report where Origin like '" & txtOrigin
& "*'"

what you need is

dim strSql as string

strSql = "select * from [tblDaily Report] where Origin like '" & txtOrigin &
"*'"

if you really do have a space in the name
 
G

Guest

Hi Alex,

Thanks for the quick reply.
Yes, my table name there's a space.
But after editing what you have told me to do so, it still prompted me that
message.
Any idea what's wrong with it?
Or i had did the form wrongly at the start? Can you guide me on what are the
criteria that i required to do before putting this code?
Thanks

Best Regards
Green


Alex White MCDBA MCSE said:
You are setting the value on the declaration line (cannot currently do in
vba) and does your table name have a space in it.

dim strSql = "select * from tblDaily Report where Origin like '" & txtOrigin
& "*'"

what you need is

dim strSql as string

strSql = "select * from [tblDaily Report] where Origin like '" & txtOrigin &
"*'"

if you really do have a space in the name


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Albert,

I currently required to do something as u showed as screen shots...
is had used the code below... but have an error as shown below:

Daily Report can't find the macro 'dim strSql = "select * from tblDaily
Report where Origin like '" & txtOrigin & "*'"

me.Daily Report1.Form.RecordSouce = strSql '

The macro (or its macro group) doesn't exist, or the macro is new but hasn't
been saved.
Note that when you enter the macrogroupname.macroname syntax in an
argument,
you must specify the name the macro's macro group was last saved under.


Did i do anything wrong on it? Pls advice...
Sorry i not gd in SQL....

Thanks
Green
 
A

Alex White MCDBA MCSE

Need a couple of things from you,

what type of field is the origin field?
where or what form are you calling the code from?

if you Origin field is a text field then

for access

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "*'"

for SQL

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "%'"

I would strongly recomend not using spaces in any names (tables/fields/etc),
as it complicates things. use _ for spaces makes your life easier.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Thanks for the quick reply.
Yes, my table name there's a space.
But after editing what you have told me to do so, it still prompted me
that
message.
Any idea what's wrong with it?
Or i had did the form wrongly at the start? Can you guide me on what are
the
criteria that i required to do before putting this code?
Thanks

Best Regards
Green


Alex White MCDBA MCSE said:
You are setting the value on the declaration line (cannot currently do in
vba) and does your table name have a space in it.

dim strSql = "select * from tblDaily Report where Origin like '" &
txtOrigin
& "*'"

what you need is

dim strSql as string

strSql = "select * from [tblDaily Report] where Origin like '" &
txtOrigin &
"*'"

if you really do have a space in the name


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Albert,

I currently required to do something as u showed as screen shots...
is had used the code below... but have an error as shown below:

Daily Report can't find the macro 'dim strSql = "select * from tblDaily
Report where Origin like '" & txtOrigin & "*'"

me.Daily Report1.Form.RecordSouce = strSql '

The macro (or its macro group) doesn't exist, or the macro is new but
hasn't
been saved.
Note that when you enter the macrogroupname.macroname syntax in an
argument,
you must specify the name the macro's macro group was last saved under.


Did i do anything wrong on it? Pls advice...
Sorry i not gd in SQL....

Thanks
Green


:

I usually make a main form, and then throw in a sub-form to "list" the
hits.

In the mains form text box after update event, you can do:

dim strSql = "select * from tblCustomers where City like '" & txtCity
&
"*'"

me.myCoolSubForm.Form.RecordSouce = strSql

The above will give you a nice list. Here is some screen shots and
some
ideas of the above code in action:

http://www.members.shaw.ca/AlbertKallal/Search/index.html
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
 
G

Guest

Hi Alex,

Thanks for helping :)
The feld type is text
The main form is Origin_search and the subform where those records will be
filtered and shown is Daily_Report_Subform
Hope that i have answer your question

Thanks
Green

Alex White MCDBA MCSE said:
Need a couple of things from you,

what type of field is the origin field?
where or what form are you calling the code from?

if you Origin field is a text field then

for access

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "*'"

for SQL

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "%'"

I would strongly recomend not using spaces in any names (tables/fields/etc),
as it complicates things. use _ for spaces makes your life easier.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Thanks for the quick reply.
Yes, my table name there's a space.
But after editing what you have told me to do so, it still prompted me
that
message.
Any idea what's wrong with it?
Or i had did the form wrongly at the start? Can you guide me on what are
the
criteria that i required to do before putting this code?
Thanks

Best Regards
Green


Alex White MCDBA MCSE said:
You are setting the value on the declaration line (cannot currently do in
vba) and does your table name have a space in it.

dim strSql = "select * from tblDaily Report where Origin like '" &
txtOrigin
& "*'"

what you need is

dim strSql as string

strSql = "select * from [tblDaily Report] where Origin like '" &
txtOrigin &
"*'"

if you really do have a space in the name


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

Hi Albert,

I currently required to do something as u showed as screen shots...
is had used the code below... but have an error as shown below:

Daily Report can't find the macro 'dim strSql = "select * from tblDaily
Report where Origin like '" & txtOrigin & "*'"

me.Daily Report1.Form.RecordSouce = strSql '

The macro (or its macro group) doesn't exist, or the macro is new but
hasn't
been saved.
Note that when you enter the macrogroupname.macroname syntax in an
argument,
you must specify the name the macro's macro group was last saved under.


Did i do anything wrong on it? Pls advice...
Sorry i not gd in SQL....

Thanks
Green


:

I usually make a main form, and then throw in a sub-form to "list" the
hits.

In the mains form text box after update event, you can do:

dim strSql = "select * from tblCustomers where City like '" & txtCity
&
"*'"

me.myCoolSubForm.Form.RecordSouce = strSql

The above will give you a nice list. Here is some screen shots and
some
ideas of the above code in action:

http://www.members.shaw.ca/AlbertKallal/Search/index.html
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
 
A

Alex White MCDBA MCSE

Hi,

You are using the phrase subform, do you really mean a form embeded within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a listbox on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Thanks for helping :)
The feld type is text
The main form is Origin_search and the subform where those records will be
filtered and shown is Daily_Report_Subform
Hope that i have answer your question

Thanks
Green

Alex White MCDBA MCSE said:
Need a couple of things from you,

what type of field is the origin field?
where or what form are you calling the code from?

if you Origin field is a text field then

for access

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "*'"

for SQL

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
txtOrigin.value & "%'"

I would strongly recomend not using spaces in any names
(tables/fields/etc),
as it complicates things. use _ for spaces makes your life easier.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Thanks for the quick reply.
Yes, my table name there's a space.
But after editing what you have told me to do so, it still prompted me
that
message.
Any idea what's wrong with it?
Or i had did the form wrongly at the start? Can you guide me on what
are
the
criteria that i required to do before putting this code?
Thanks

Best Regards
Green


:

You are setting the value on the declaration line (cannot currently do
in
vba) and does your table name have a space in it.

dim strSql = "select * from tblDaily Report where Origin like '" &
txtOrigin
& "*'"

what you need is

dim strSql as string

strSql = "select * from [tblDaily Report] where Origin like '" &
txtOrigin &
"*'"

if you really do have a space in the name


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

Hi Albert,

I currently required to do something as u showed as screen shots...
is had used the code below... but have an error as shown below:

Daily Report can't find the macro 'dim strSql = "select * from
tblDaily
Report where Origin like '" & txtOrigin & "*'"

me.Daily Report1.Form.RecordSouce = strSql '

The macro (or its macro group) doesn't exist, or the macro is new
but
hasn't
been saved.
Note that when you enter the macrogroupname.macroname syntax in an
argument,
you must specify the name the macro's macro group was last saved
under.


Did i do anything wrong on it? Pls advice...
Sorry i not gd in SQL....

Thanks
Green


:

I usually make a main form, and then throw in a sub-form to "list"
the
hits.

In the mains form text box after update event, you can do:

dim strSql = "select * from tblCustomers where City like '" &
txtCity
&
"*'"

me.myCoolSubForm.Form.RecordSouce = strSql

The above will give you a nice list. Here is some screen shots and
some
ideas of the above code in action:

http://www.members.shaw.ca/AlbertKallal/Search/index.html
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
 
G

Guest

Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green
 
A

Alex White MCDBA MCSE

Yep small typo

strSQL = "Select * from Daily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

the above is correct if,

you have a field called Origin in a table called Daily_Report
you have a textbox on the form called txtOrigin

the typo was the table name

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green

Alex White MCDBA MCSE said:
Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
G

Guest

Hi Alex,

Sorry...
there is an error on the line same line again...
"compile error: syntax error"
I have checked the table and yes, the Daily_Report has a field named Origin
and I have changed the text box on the form to txtOrigin
Sorry for the troubles

Best Regards
Green

Alex White MCDBA MCSE said:
Yep small typo

strSQL = "Select * from Daily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

the above is correct if,

you have a field called Origin in a table called Daily_Report
you have a textbox on the form called txtOrigin

the typo was the table name

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green

Alex White MCDBA MCSE said:
Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
A

Alex White MCDBA MCSE

Can you change the line to:-

strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "1*" & chr(34)

the reason for this is I think the error is in the speech marks the chr(34)
is ascii for " so it enters them into the line without any problems. Does
what I am sugesting make sense?

your strings have to be enclosed within speech marks for the select
statement to work.

Good luck..

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Sorry...
there is an error on the line same line again...
"compile error: syntax error"
I have checked the table and yes, the Daily_Report has a field named
Origin
and I have changed the text box on the form to txtOrigin
Sorry for the troubles

Best Regards
Green

Alex White MCDBA MCSE said:
Yep small typo

strSQL = "Select * from Daily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

the above is correct if,

you have a field called Origin in a table called Daily_Report
you have a textbox on the form called txtOrigin

the typo was the table name

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is
error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green

:

Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a
listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
G

Guest

Hi Alex,

I will try it out and let you know it soon...
No matter whether it is successful, I really appreciate your help!

Thanks
Green

Alex White MCDBA MCSE said:
Can you change the line to:-

strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "1*" & chr(34)

the reason for this is I think the error is in the speech marks the chr(34)
is ascii for " so it enters them into the line without any problems. Does
what I am sugesting make sense?

your strings have to be enclosed within speech marks for the select
statement to work.

Good luck..

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Sorry...
there is an error on the line same line again...
"compile error: syntax error"
I have checked the table and yes, the Daily_Report has a field named
Origin
and I have changed the text box on the form to txtOrigin
Sorry for the troubles

Best Regards
Green
EAD
:
Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a
listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
G

Guest

Hi Alex,

it is still unsuccessful... i don't think that is the problem...
is there any other way to change the "me." ? I'm thinking whether it is the
problem.... but i may be wrong...

Best Regards
Green


Alex White MCDBA MCSE said:
Can you change the line to:-

strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "1*" & chr(34)

the reason for this is I think the error is in the speech marks the chr(34)
is ascii for " so it enters them into the line without any problems. Does
what I am sugesting make sense?

your strings have to be enclosed within speech marks for the select
statement to work.

Good luck..

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Sorry...
there is an error on the line same line again...
"compile error: syntax error"
I have checked the table and yes, the Daily_Report has a field named
Origin
and I have changed the text box on the form to txtOrigin
Sorry for the troubles

Best Regards
Green

Alex White MCDBA MCSE said:
Yep small typo

strSQL = "Select * from Daily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

the above is correct if,

you have a field called Origin in a table called Daily_Report
you have a textbox on the form called txtOrigin

the typo was the table name

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is
error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green

:

Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a
listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
G

Guest

Hi Alex,

I manage to remove the error... but there is an run time error '424'
Oject Required.

What is this???
Pls advice

Thanks
Green

'green' said:
Hi Alex,

it is still unsuccessful... i don't think that is the problem...
is there any other way to change the "me." ? I'm thinking whether it is the
problem.... but i may be wrong...

Best Regards
Green


Alex White MCDBA MCSE said:
Can you change the line to:-

strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "1*" & chr(34)

the reason for this is I think the error is in the speech marks the chr(34)
is ascii for " so it enters them into the line without any problems. Does
what I am sugesting make sense?

your strings have to be enclosed within speech marks for the select
statement to work.

Good luck..

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

'green' said:
Hi Alex,

Sorry...
there is an error on the line same line again...
"compile error: syntax error"
I have checked the table and yes, the Daily_Report has a field named
Origin
and I have changed the text box on the form to txtOrigin
Sorry for the troubles

Best Regards
Green

:

Yep small typo

strSQL = "Select * from Daily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

the above is correct if,

you have a field called Origin in a table called Daily_Report
you have a textbox on the form called txtOrigin

the typo was the table name

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

Hi Alex,

Really sorry to trouble you again...
but after i put it in to the properties-after update field, there is
error
in this line:
strSQL = "Select * from tblDaily_Report where Origin Like '" &
me.txtOrigin.value & "*'"

I have listened to your advice and changed the table named to:
"Daily_Report".
Did i put in the correct field?
Sorry i have totally no knowlegde on coding...

Best Regards
Green

:

Hi,

You are using the phrase subform, do you really mean a form embeded
within
another form, or just called from the Origin_search form?

if it is a sub form then the following should work


** Start **

dim strSQL as string

strSQL = "Select * from [tblDaily Report] where Origin Like '" &
me.txtOrigin.value & "*'"

Form_Origin_search.Daily_Report_Subform.Form.RecordSource = strSQL

Form_Origin_search.Daily_Report_Subform.Requery

** End **

For the above to work it must be called from the Origin_search form.


Do you need to edit this data?, because if you don't then using a
listbox
on
the main form maybe the best answer to your specific problem.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 

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