missing object error

A

AR Hall

I have this bit of code to write to an accesss database. Simiar code works
in another XL 97 app.
Why am I getting this missing object error

Sub dBSave()

Dim db As database
Dim rs As Recordset

Dim strSheet As String
Dim actworkbook As Workbook
Set actworkbook = ThisWorkbook

strSheet = ThisWorkbook.ActiveSheet.Name

Set db = OpenDatabase("S:\Production Database\ProductionData_tables.MDB")
Set rs = db.OpenRecordset("tblProductionRunHeader")

'populate variables with sheet data

'Get Header Data
Header.RptDate = ActiveSheet.Range("k3").Value <Object Error Here>
Header.shift = ActiveSheet.Range("h3").Value
Header.supervisor = ActiveSheet.Range("k4").Value
Header.RptTime = ActiveSheet.Range("h4").Value
 
A

AR Hall

hey chip
been a while since i programmed in XL but I think your question is the right
one.
header is delcared as a user defined type in the declarations, but i must be
doing something wrong because that is where I found the hang-up to be. I
removed the reference to that variable substituted a procedure level
variable "x" and the error went away.

public type header
id as integer
rptdate as date
rpttime as date
end type

thanks for the rapid response.
 
Top