hovercraft
Technical User
Greetings,
This has been driving me nuts for a couple of days.
I have 2 global variables; var_lastname and var_firstname. I also have 2 functions that return the value of their respective variables (fun_lastname, fun_firstname). I then use the functions as criteria in a query.
I am using a form to accept search criteria. On it is 2 text boxes. txt_lastname, txt_firstname.
There a button to initiate the search. cmd_search.
The code on the click event is:
if (isnull(txt_lastname)=false) then
var_lastname = txt_lastname
else:
var_lastname = "like('*')"
end if
if (isnull(txt_firstname)=false) then
var_firstname = txt_firstname
else:
var_firstname = "like('*')"
end if
This works as long as I make an entry in both text boxes and I know that the problem is the "like('*')". The value of the variable is set to literally "like('*')", but I don't know how to fix it.
What I am trying to do is to have the functions pass a wildcard in the query if the text box is blank.
any advice is greatly appreciated.
Hovercraft
This has been driving me nuts for a couple of days.
I have 2 global variables; var_lastname and var_firstname. I also have 2 functions that return the value of their respective variables (fun_lastname, fun_firstname). I then use the functions as criteria in a query.
I am using a form to accept search criteria. On it is 2 text boxes. txt_lastname, txt_firstname.
There a button to initiate the search. cmd_search.
The code on the click event is:
if (isnull(txt_lastname)=false) then
var_lastname = txt_lastname
else:
var_lastname = "like('*')"
end if
if (isnull(txt_firstname)=false) then
var_firstname = txt_firstname
else:
var_firstname = "like('*')"
end if
This works as long as I make an entry in both text boxes and I know that the problem is the "like('*')". The value of the variable is set to literally "like('*')", but I don't know how to fix it.
What I am trying to do is to have the functions pass a wildcard in the query if the text box is blank.
any advice is greatly appreciated.
Hovercraft