Can a text box call a variable in 2003?

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

In access 2000,2002 I had a report text box that could
reference a public variable in the report module. Access
2003 doesn't seem to like it, returning a #name?
 
Mike said:
In access 2000,2002 I had a report text box that could
reference a public variable in the report module. Access
2003 doesn't seem to like it, returning a #name?

"Report text box that could reference a public variable"? How? That isn't
supported in any version of Access, AFAIK. The workaround has been to create
a user defined function that accessed the variable and returned it (or a
result using it).

Larry Linson
Microsoft Access MVP
 
I guess I'll switch to function calls for 2003

This is how I got it to work in Access 2000,2002



Option Compare Database
Public timestamp As String
Public Final As String
Public StartPage As Integer



Private Sub Report_Open(Cancel As Integer)

timestamp = Now()

response = MsgBox("Final run for book", vbYesNo)
If response = vbYes Then
StartPage = InputBox("Starting page number")
Final = "Y"
Else
StartPage = 1
Final = "N"
End If

End Sub

and this is what I had in the text boxes:


=[Page]+[StartPage]-1

=IIf([Final]="N",[timestamp],"")
 
Back
Top