"compilation error: variable not defined"

G

Guest

OK...this is strange.

I have a db that is perfectly fine and operates the way it should. I
recently made a copy of the db to use for testing and development. Everything
crossed over the way it should. Now, however, when I try to use the
WhereBuilder to build a report, the initial form comes up with the report
names available, but as soon as I choose one I get the VB code app and an
idiot box which reads "compilation error: variable not defined."

I've examined both the original and the new db to see what has changed, but
nothing has changed. The code is the same, the properties are the same....as
far as I can tell, they are identical.

Ideas??????
 
A

Andi Mayer

OK...this is strange.

I have a db that is perfectly fine and operates the way it should. I
recently made a copy of the db to use for testing and development. Everything
crossed over the way it should. Now, however, when I try to use the
WhereBuilder to build a report, the initial form comes up with the report
names available, but as soon as I choose one I get the VB code app and an
idiot box which reads "compilation error: variable not defined."

I've examined both the original and the new db to see what has changed, but
nothing has changed. The code is the same, the properties are the same....as
far as I can tell, they are identical.

Ideas??????
which line is yellow in the debugger?
 
G

Guest

Sorry, I just realized that I left that out.....the sub it references is
below and the yellow line is highlighting the "Private Sub" line, with a
brown highlight of the "strOrderBy""" line. the code is exactly the same in
the version of the db that works.......

Private Sub lstReportList_Click()
'Reinitialize the following global variables
strOrderBy = ""
strWhere = ""
strWhereOrderBy = ""
strQueryName = ""

'Look up the Query Name for the selected Report
strQueryName = DLookup("[TableQuery]", "RunReport",
"[ReportName]=lstReportList")
End Sub
 
A

Andi Mayer

Sorry, I just realized that I left that out.....the sub it references is
below and the yellow line is highlighting the "Private Sub" line, with a
brown highlight of the "strOrderBy""" line. the code is exactly the same in
the version of the db that works.......

Private Sub lstReportList_Click()
'Reinitialize the following global variables
strOrderBy = ""
strWhere = ""
strWhereOrderBy = ""
strQueryName = ""

'Look up the Query Name for the selected Report
strQueryName = DLookup("[TableQuery]", "RunReport",
"[ReportName]=lstReportList")
End Sub
is there a line:
Public strOrderBy as string

somewhere in your mdb?

and on top of the module is: Option explicit
that's good, because then you have to dim your variables
 
G

Guest

That was the problem.....I was missing the WhereBuilder module. thanks........

Andi Mayer said:
Sorry, I just realized that I left that out.....the sub it references is
below and the yellow line is highlighting the "Private Sub" line, with a
brown highlight of the "strOrderBy""" line. the code is exactly the same in
the version of the db that works.......

Private Sub lstReportList_Click()
'Reinitialize the following global variables
strOrderBy = ""
strWhere = ""
strWhereOrderBy = ""
strQueryName = ""

'Look up the Query Name for the selected Report
strQueryName = DLookup("[TableQuery]", "RunReport",
"[ReportName]=lstReportList")
End Sub
is there a line:
Public strOrderBy as string

somewhere in your mdb?

and on top of the module is: Option explicit
that's good, because then you have to dim your variables
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top