anyway regardless of that i am getting an error:
object variable or With block variable not set
here is the lines of code, ssql is a select statement and it is set i just took it out because it was so long
Dim ssql As String
Dim stDocName As String
Dim mydb As Database
Dim myquerydef As querydef
Set myquerydef = mydb.CreateQueryDef("qdef_dy", ssql)
stDocName = "repCBL"
DoCmd.OpenReport stDocName, acPreview, "qdef_dy"
it highlights the Set line as the error when i lick debug
i dont know if its important but when i declared the myquerydef variable above it did not capitalize the data type 'querydef' as 'QueryDef'. i found this odd as it usually changes the types to match capitalization