Setting the "Format" property as a variable

R

Rob Ivy

All, I may be overlooking something obvious, but here's my
predicament:
Using Access2000, I'm attempting to set the "Format" property of a
report field equal the value of another field in the query upon which
the report is based. I'm using the dialog box GUI rather than VBA...my
skills aren't quite there yet on VBA. Anyway, whenever I try to enter
a field name as the "Format" property, Access thinks that's a hard
syntax, as if I were using ##s, etc.

Bottom line is that for certain records, this field needs to be
formatted as %, for certain records $, and for certain records,
"Standard".

Any help is much appreciated.

Rob Ivy
Nashville, TN
 
D

Dirk Goldgar

Rob Ivy said:
All, I may be overlooking something obvious, but here's my
predicament:
Using Access2000, I'm attempting to set the "Format" property of a
report field equal the value of another field in the query upon which
the report is based. I'm using the dialog box GUI rather than VBA...my
skills aren't quite there yet on VBA. Anyway, whenever I try to enter
a field name as the "Format" property, Access thinks that's a hard
syntax, as if I were using ##s, etc.

Bottom line is that for certain records, this field needs to be
formatted as %, for certain records $, and for certain records,
"Standard".

I think you'll have to set the Format property using VBA in the detail
section's Format event:

'---- start of example code ----
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Me!Text1.Format = Me!Text2

End Sub

'---- end of example code ----
 

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