Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA field referencing

Status
Not open for further replies.

EagleTempest

Technical User
Jun 15, 2004
125
CA
Access 2002

Hi, I'm new to creating reports in Access.

The Record Source for my report is:

SELECT qryBenchsheet.* FROM qryBenchsheet;

simple enought right? I have the following code for my Detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If MuntinSquares = 0 Then
Me.txtMuntinSquares = ""
Else
Me.txtMuntinSquares = Me![MuntinSquares]
End If
End Sub

Do I have to actually have the field MuntinSquares on my report? I receive a "MS Access can't find the field 'MuntinSquares' referred to in your expression." error. But I know that the field is part on the Record Source.

I don't want a 0 (Zero) shown in the textbox call txtMuntinSquares.
 
I don't know, but that's the workaraound I've used (having one invisible control bound to the field, then assigned that controls value to the other control), or in this case you could for instance bind the control to the field, and use something like this:

[tt]Me!txtMuntinSquares.visible=(Me!txtMuntinSquares.value<>0)[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top