OK, I am sure this is another blonde moment, but I prefer to be blonde than bald ...
I have created a search by company that works great. It returns only values in the company field of my table. I have taken this same code and changed the company field information to my last_name field for a last name search.
What I get in my list box is the first name and last name but the search is by first name. Below is the code I am using and nowhere do I even mention the first name. Where is Alpha pulling that from?
I should be getting: Johnson instead I get John LastName
I have created both the company and last name searches via a button on a form. I have used the OnPush event for each button with xbasic. Below is the code used for my last_name search.
Why am I getting the first name + last name? What am I missing here?
Thanks
Cheryl
'Date Created: 03-Aug-2004 06:30:48 PM
'Last Updated: 03-Aug-2004 06:37:14 PM
'Created By :
'Updated By :
'Print invoices based on last name
filter = " (Last_Name = [varC-"prms.Parameter1] )"
get_parameters_string = ""%string%
Parameter1|Last_Name|Character|Record List-Combo Box||"table_name="t_inv""\cr\lf"field_name="Last_Name""\cr\lf"filter="""\cr\lf
%string%
ok_label = "&OK"
cancel_label = "&Cancel"
dialog_title = "Parameters"
'Prompt for parameter values. Store results in a 'dot' variable called 'prms'
dim prms as p
prms = ui_get_parameters(dialog_title,get_parameters_string,ok_label,cancel_label)
if prms.last_button_pressed = "OK" then
'Replace parameters in the filter with actual values
query.filter = replace_parameters(filter,local_variables())
query.order = ""
else
end
end if
'Prompt user whether to print, or preview the layout. Set default to Preview
prompt_result = ui_get_print_or_preview("Preview")
If prompt_result = "Print" then
:Report.Print("r_invoice",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("r_invoice",query.filter,query.order)
End if
I have created a search by company that works great. It returns only values in the company field of my table. I have taken this same code and changed the company field information to my last_name field for a last name search.
What I get in my list box is the first name and last name but the search is by first name. Below is the code I am using and nowhere do I even mention the first name. Where is Alpha pulling that from?
I should be getting: Johnson instead I get John LastName
I have created both the company and last name searches via a button on a form. I have used the OnPush event for each button with xbasic. Below is the code used for my last_name search.
Why am I getting the first name + last name? What am I missing here?
Thanks
Cheryl
'Date Created: 03-Aug-2004 06:30:48 PM
'Last Updated: 03-Aug-2004 06:37:14 PM
'Created By :
'Updated By :
'Print invoices based on last name
filter = " (Last_Name = [varC-"prms.Parameter1] )"
get_parameters_string = ""%string%
Parameter1|Last_Name|Character|Record List-Combo Box||"table_name="t_inv""\cr\lf"field_name="Last_Name""\cr\lf"filter="""\cr\lf
%string%
ok_label = "&OK"
cancel_label = "&Cancel"
dialog_title = "Parameters"
'Prompt for parameter values. Store results in a 'dot' variable called 'prms'
dim prms as p
prms = ui_get_parameters(dialog_title,get_parameters_string,ok_label,cancel_label)
if prms.last_button_pressed = "OK" then
'Replace parameters in the filter with actual values
query.filter = replace_parameters(filter,local_variables())
query.order = ""
else
end
end if
'Prompt user whether to print, or preview the layout. Set default to Preview
prompt_result = ui_get_print_or_preview("Preview")
If prompt_result = "Print" then
:Report.Print("r_invoice",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("r_invoice",query.filter,query.order)
End if
Comment