Good morning all. I have the following issue, it seems very stupid but I'm becoming crazy to understand why I got it:
In a Private Sub a declare 2 variables as follow :
Dim dbs As DAO.Database
Dim tmpl As Recordset
Then, as part of the program, i have the following script:
Set tmpl = dbs.OpenRecordset(" SELECT *" & _
" FROM template-FLOC" & _
" WHERE [Level] = '4'", dbOpenDynaset)
Do Until tmpl.EOF
(etc. etc)
........................
tmpl.MoveNext
Loop
Regardless the program is well compiled, it seems the variable tmpl is not set and, during the debug (step by step) when i try to verify the tmpl.Recordset value, i got Run-time Error '91' - Object variable or With block variable not set.
I really cannot understand why, i don't see any issue in the program but the Set looks like doesn't work.
Any suggestion from your experience ?
Thank you,
Cheers
Leo