>>Hello, Everyone.
>>I've got a problem on REPORT FORM command. I can't select my desire record to print by REPORT FORM ... FOR command. In the print preview, all records of the table were displayed on the screen. It seem the command can't recongize the condition, however, I used SET FILTER command, it still can't work.
>>
>>The full sentence :
>>
>>REPORT FORM HOME()+"Report\Employee_All_Report.FRX" for Employee.staff_no=thisform.cur_staff_no PREVIEW
>>
>>where thisform.cur_staff_no is a value
>>
>>Also, I quit the program and tried this command on the command window but it still can't work.
>>
>>Is there anyone know why? I use this command many many times but I haven't face this problem before.
>>
>>Sunny
>
>Anything Strange in your data environment for the report. Try taking the table out of the data environment. Open it before running the report. Any strange functions imbedded within the report that maight cause problems? Are U using private data sessions? .... Steve
Sunny: Have you tried this with a real staff #? For example:
REPORT FORM HOME()+"Report\Employee_All_Report.FRX" for Employee.staff_no='12345' PREVIEW
I think you're having problems with the way the condition is written. Usually you need to set up the condition without referring to another form, because when it is read, you are inside the report.
cCond = "Employee.staff_no = '" + thisform.cur_staff_no + "'"
REPORT FORM HOME()+"Report\Employee_All_Report.FRX" for &cCond
Note that the value for thisform.Cur_staff_no is surrounded by quote marks which are added to the phrase. You have to be careful about single and double quotes!!! If you looked at cCond it would look like
Employee.staff_no = '12345'
HTH
Barbara