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