A
Alex White MCDBA MCSE
Hi,
couple of things,
strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "*" & chr(34)
you did remove the 1 before the last * in the line above?
and even though your sub form is called
Daily_Report_SubForm
if you type
Form_Origin_search.Daily_Report_Subform.Form
when you put the . on the end of that line do you get the context list come
up, because if you don't then it sounds like the subform has been renamed
once embeded on the main form, to check this right mouse click on the small
black frame around the subform when in design mode to get the properties of
the subform.
--
Regards
Alex White MCDBA MCSE
http://www.intralan.co.uk
couple of things,
strSQL = "Select * from Daily_Report Where Origin Like " & chr(34) &
me.txtOrigin.value & "*" & chr(34)
you did remove the 1 before the last * in the line above?
and even though your sub form is called
Daily_Report_SubForm
if you type
Form_Origin_search.Daily_Report_Subform.Form
when you put the . on the end of that line do you get the context list come
up, because if you don't then it sounds like the subform has been renamed
once embeded on the main form, to check this right mouse click on the small
black frame around the subform when in design mode to get the properties of
the subform.
--
Regards
Alex White MCDBA MCSE
http://www.intralan.co.uk
'green' said: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
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