Setting the "Format" property as a variable

  • Thread starter Thread starter Rob Ivy
  • Start date Start date
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
 
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 ----
 
Back
Top