Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question.. table with one record

Status
Not open for further replies.

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
 
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.

 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top