Results 1 to 6 of 6

Thread: Formatting issue

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    14

    Formatting issue

    Hey all - sorry if this has been answered somewhere before - but I'm having a heck of a time finding right answer.

    I'm using VB 2008 and reading data from an access 2003 database.
    I have a query setup in access - read in as a 'view' in vb ... that is showing results of first pass yield. total good parts... total bad parts... and percentage of yield. in my access query - i have the percentage displaying properly using the column format in access... however - on my form -
    the data source comes in as a textbox...by default.

    I can't seem to google the right question - but right now on my form, even though the dataset recognizes it as a double precision number - the option in the datasource tab - shows it as a text box or data grid right ...

    so on my form i have the text box or details option... but my text box shows the percentage as a long decimal ... .98936524 or whatever...

    what's the correct string i need to format the textbox.text to display a percentage?

    I tried format(val(textbox.text), 0.00) that didn't do anything...
    and I did this under the form load section after the data sets were filled.

    thanks for any suggestions... I'm at a loss.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    14

    Re: Formatting issue

    Thanks, but I'm not sure I follow.

    I've added the "details" of my dataset to the form....
    this generated textboxes for each column of my 'view' or qccess query.

    The query comes back with 4 columns, and only one row of information.

    each text box then, only has one value. the textbox.text ...

    I need to format textbox.text to show % ... not a double precision decimal of about 6 places... and that's where I'm stuck. do I need to convert or take the val(texbox.text) - then format that? do i need to read the textbox value - format and assign to a label instead? I looked at the masked textbox 0 but it doesn't seem that I can databind it.

  4. #4

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    14

    Re: Formatting issue

    Ok - I understand that as far as being a variable input ...
    but this is for output purposes.

    I'm not assigning a value - the value is already assigned to textbox.text
    I just need to display it correctly.

    make sense?

    the form loads and populates the textbox.text property...

  6. #6
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Formatting issue

    variable or expression - there's no difference
    You assigned this expression to the TextBox somehow? All you have to do is to assign a formatted expression instead.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width