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!

simple format question 1

Status
Not open for further replies.

miscluce

MIS
Oct 4, 2007
149
US
I have a combo box with 2 columns on a from and a report.

when I open the report I have some textboxes that are all formatted to currency in the property window but this one text box still shows the number like this 122 instead of this $122.

The control source for text7 is:
= [Forms]![frmPurchaseCar]![Combo15].[column](2)

and combo15 does show it as a currency and so does the table it is in. Just not the text 7 control. This value is coming from a combo box so I am thinking there is something different I need to do compared to a text box. I just am not sure what that is?

 
Use the Format() function to force the format you wish in the textbox.

RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
I have tried that. I am having trouble with the syntax becasue I keep getting acompile error expected : expression .


Me.Text7.ControlSource = Format([Forms]![frmPurchaseCar]![Combo15].Column(2),currency)

 
I also tried this with the expression builder but no luck. I get a #NAME?

=Format([Forms]![frmPurchaseCar]![Combo15],[Currency])
 
oops, I meant I tried this with teh expression builder

=Format([Forms]![frmPurchaseCar]![Combo15].column(2),[Currency])
 
Because you put square brackets around Currency, it thinks it's a field name, which of course doesn't exist (hence the #NAME error). Try quotes instead.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
bcause you put square brackets around Currency"

I didn't put those brackets. Access does that with the expression builder
 
Thanks,

I finally got it. first, I tried this in VB but no luck. than I did this in the expression builder and it worked

=Format([Forms]![frmPurchaseCar]![Combo15].column(2), "Currency")

 
=Format([Forms]![frmPurchaseCar]![Combo15].Column(2),[!]"[/!]Currency[!]"[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Try leaving your 1st control as it was originally but make it invisible. Then create a 2nd control with its ControlSource set to =Format(Me.1stControlName,"Currency")
...using your ControlNames of course.

RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top