Jul 2, 2002 #1 Judalie Programmer Mar 25, 2002 40 US I have a table that has one record which denotes the location, date and name of event, site code, etc... (wild horse and burro adoption) i have several reports that i want to have this data show up in the header... how can i do this...thanks,j
I have a table that has one record which denotes the location, date and name of event, site code, etc... (wild horse and burro adoption) i have several reports that i want to have this data show up in the header... how can i do this...thanks,j
Jul 2, 2002 #2 grnzbra Programmer Mar 12, 2002 1,273 US create some global variables for the fields in the report Read the record and set the fields in the header equal to the appropriate field in the recoreset. dim db as database dim rs as recordset sim sqlstr as str sqlstr = "SELECT * FROM TheOneRecordTable" set db = currentdb set rs = db.openrecordset (sqlstr) variable1 = rs!field1 variable2 = rs!field2 etc Then set the header fields equal to the appropriate global variables. You may have to create a function and set the fields equal to the function public function func_variable1() func_variable1 = variable1 end function then the control source for the field1 would be set to: =func_variable1 this should work. Upvote 0 Downvote
create some global variables for the fields in the report Read the record and set the fields in the header equal to the appropriate field in the recoreset. dim db as database dim rs as recordset sim sqlstr as str sqlstr = "SELECT * FROM TheOneRecordTable" set db = currentdb set rs = db.openrecordset (sqlstr) variable1 = rs!field1 variable2 = rs!field2 etc Then set the header fields equal to the appropriate global variables. You may have to create a function and set the fields equal to the function public function func_variable1() func_variable1 = variable1 end function then the control source for the field1 would be set to: =func_variable1 this should work.
Jul 3, 2002 Thread starter #3 Judalie Programmer Mar 25, 2002 40 US thanks...i tried this but didn't work..where do i put the code... i'm new at this...and put the code in the report general - declarations option compare database is what i see when opening vb ...do i put the code here? i tried that and get #name? what am i doing wrong,,thanks much!!!J Upvote 0 Downvote
thanks...i tried this but didn't work..where do i put the code... i'm new at this...and put the code in the report general - declarations option compare database is what i see when opening vb ...do i put the code here? i tried that and get #name? what am i doing wrong,,thanks much!!!J