Hello all,
I am unable to get the $ to work properly. I am not getting any errors but I am getting all records returned in my embedded browse. I have attached a sample db in case you need it.
I have two fields in my 'lookup' table, both character fields ... I prefer my 2nd field to be a memo field but thought that maybe that was my problem. I changed to character and still cannot get it to work.
When the form is loaded you are prompted for text to search on. The text you input is placed in a global variable vcgICD9Text. The online help shows use of the $ this way:
"Computer" $ Company
"Computer" being the search text and Company being the field name
In my case I am using the variable in place of the search text so my filter theoretically should look like this:
query.filter = vcgICD9Text $ DESC
DESC being my field name.
At the end of the message are the different query.filter that I tried with the results I received. Tested all of them with my DESC field as memo and as character. The attached zip currently has DESC as a character field.
Since I am not getting any errors, this leads me to think that it is the query.filter line that I am trying is not reading the value of my variable and comparing it to the DESC field data.
The xdialog and script below are both in the OnInit event of the lookup form. What am I doing wrong?
Thanks
Cheryl
========================
dim tbl as P
dim qry as P
dim nrecs as N
tbl = table.current()
query.description = "Search"
query.order = "code"
'query.filter = var-"vcgICD9Text $ DESC ' this returns an error that the variable DESC is not found
'query.filter = vcgICD9Text $ "lookup-"DESC" ' this does not return an error but returns all records
'query.filter = var-"vcgICD9Text $ "lookup-"DESC" ' no error, but all records returned
'query.filter = (vcgICD9Text $ "lookup-"DESC") ' no error, but all records returned
'query.filter = vcgICD9Text $ "DESC" ' no error, returns all records
'query.filter = var-"vcgICD9Text $ lookup-"DESC ' no error, returns all records
query.filter = var-"vcgICD9Text $ (lookup-"DESC) ' no error, returns all records
query.options = ""
qry = tbl.query_create()
nrecs = qry.records_get()
IF (nrecs = 0) then
qry.drop()
ui_msg_box("Null Query","There are no records in the Query" ,UI_INFORMATION_SYMBOL)
END
end if
I am unable to get the $ to work properly. I am not getting any errors but I am getting all records returned in my embedded browse. I have attached a sample db in case you need it.
I have two fields in my 'lookup' table, both character fields ... I prefer my 2nd field to be a memo field but thought that maybe that was my problem. I changed to character and still cannot get it to work.
When the form is loaded you are prompted for text to search on. The text you input is placed in a global variable vcgICD9Text. The online help shows use of the $ this way:
"Computer" $ Company
"Computer" being the search text and Company being the field name
In my case I am using the variable in place of the search text so my filter theoretically should look like this:
query.filter = vcgICD9Text $ DESC
DESC being my field name.
At the end of the message are the different query.filter that I tried with the results I received. Tested all of them with my DESC field as memo and as character. The attached zip currently has DESC as a character field.
Since I am not getting any errors, this leads me to think that it is the query.filter line that I am trying is not reading the value of my variable and comparing it to the DESC field data.
The xdialog and script below are both in the OnInit event of the lookup form. What am I doing wrong?
Thanks
Cheryl
========================
dim tbl as P
dim qry as P
dim nrecs as N
tbl = table.current()
query.description = "Search"
query.order = "code"
'query.filter = var-"vcgICD9Text $ DESC ' this returns an error that the variable DESC is not found
'query.filter = vcgICD9Text $ "lookup-"DESC" ' this does not return an error but returns all records
'query.filter = var-"vcgICD9Text $ "lookup-"DESC" ' no error, but all records returned
'query.filter = (vcgICD9Text $ "lookup-"DESC") ' no error, but all records returned
'query.filter = vcgICD9Text $ "DESC" ' no error, returns all records
'query.filter = var-"vcgICD9Text $ lookup-"DESC ' no error, returns all records
query.filter = var-"vcgICD9Text $ (lookup-"DESC) ' no error, returns all records
query.options = ""
qry = tbl.query_create()
nrecs = qry.records_get()
IF (nrecs = 0) then
qry.drop()
ui_msg_box("Null Query","There are no records in the Query" ,UI_INFORMATION_SYMBOL)
END
end if
Comment