"compilation error: variable not defined"

  • Thread starter Thread starter Guest
  • Start date Start date
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??????
 
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?
 
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
 
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
 
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
 
Back
Top