var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Strange Error
Im encountering a problem which is quite new to me. I have not written code for over a year now and would like some assistance with this problem if possible.
I have the following loop code
Option Compare Database
Private Function Department_Data()
Dim dbs As Database
Dim rsdept As Recordset
Dim qdf As Querydef
Set dbs = CurrentDb
Set rsdept = dbs.OpenRecordset("divisionanddepartments") ---- this line
Set qdf = dbs.QueryDefs("Perido sku update")
Do Until rsdept.EOF
qdf("enterdept") = rsdept!["Department Number"]
HOwever when trying to step through the data I am getting an error on the highlighted line which says run time error 13 type mismatch. I do not understand why yhis is happening??
Thanks in advance
If "divisionanddepartments" is a table or query name, try without the "". When you use "" what's between them must be an SQL statement.
What version of Access are you using? If you are using something other than Access 97 then you will probably need to add a reference to DAO and add DAO. to the beginning of the Dim statements.
Dim dbs As DAO.Database
Dim rsdept As DAO.Recordset
Set rsdept = CurrentDB.OpenRecordset("divisionanddepartments") ---- this line
Thank you all for your replies. When I placed the DAO in front of the problem it seemed to work fine.
Many thanks again