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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataFormat property is not supported for this DataSource

Status
Not open for further replies.

DMG2000

Programmer
Aug 13, 2000
52
US
I have a textbox that calls info from a db query, the value is supposed to be currency and it appears that way in the db container, however, when running the VB app, the values are being shown as integer...is there a solution to correct this, or perhaps I need to set a format in the db (it wont allow me to do a data format within VB)? Please help!

Side Note: I have tried using a format but it doesnt seem to work, unless I'm placing the code wrong...?
Subtotal.Text = Format(MyCurr, "$##0.00")
 
Could you post some more of your code? How do you retrieve the value from the database? What data type is MyCurr? Are you using an ordinary text box control?

The following code displays the value correctly in a text box control:

Dim MyCurr As Integer
MyCurr = 200
SubTotal.Text = Format(MyCurr, "$##0.00")

(text box displays $200.00)
 
Ok, let me start from the start:
I have a query in an access database that combines three different tables, with one of the field = "SubTotal". I then access the query from a "data" control, and then set the textbox("subtotal") to DataSource("data1") & DateField("SubTotal")....I run the form, and get 91 when it should be $91.00.

Dim MyCurr As Integer
MyCurr = 200 <--- should this be set to the box?
SubTotal.Text = Format(MyCurr, &quot;$##0.00&quot;)
^^^^^^^^^^^^^
Is this correct for the textbox named &quot;subtotal&quot;?


Man, I just lost myself, hope you understand what I am trying to say, and I really do appreciate your assistance.

 
If you are associating the textbox with a datasource and a datafield then you should be able to use:


Dim MyCurr As long
MyCurr = SubTotal.Text
SubTotal.Text = Format(MyCurr, &quot;\$##0.00&quot;)

You might be able to use:

SubTotal.Text = Format(SubTotal.text, &quot;\$##0.00&quot;)







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top