Advertisement

07.10.2007 at 01:39PM PDT, ID: 22687181
[x]
Attachment Details

VB.NET TextBox formatting issue

Asked by baeriali in Microsoft Visual Basic.Net, Visual Studio .NET 2005

Tags: textbox, format

I have formatted an some ADODB.Fields from SqlDB Feild object as follows:

            Dim dblInspectionFee As Double = 0
            Dim dblTaxFee As Double = 0
            Dim dblTaxValue As Double = 0
            Dim dblTotalFee As Double = 0

            dblInspectionFee = .Fields("P01_FEE").Value
            dblTaxFee = .Fields("P01_TAX").Value
            dblTaxValue = .Fields("P01_TAXRATE").Value
            dblTotalFee = .Fields("P01_TOTAL").Value

             Me.txt_InspectionFee.Text = dblInspectionFee.ToString("C")
            Me.txt_TaxFee.Text = dblTaxFee.ToString("C")
            Me.cbo_TaxValue.Text = dblTaxValue.ToString("P")
            Me.txt_TotalFee.Text = dblTotalFee.ToString("C")

My Problem is that after I do some other function (Press some button) I would like to retrieve the Values from the apropriate TextBox and perform some calculation on it.

For some reason I can not change the value of the TextBox using :

Dim dblTaxValue1 As Double = 0
dblTaxValue1 = Val(Format(Me.txt_InspectionFee.Text, "#0.00"))

Back to an string Representation without the currency symbol.  
dblTaxValue1 is not taking on the Me.txt_InspectionFee.Text value; it is remaining as 0 (initialized value)

Any ideas as to what I am doing wrong.  This would not be an issue in VB 6. the formatting in .Net seems to be working a whole lot differently.
Start Free Trial
[+][-]07.10.2007 at 02:30PM PDT, ID: 19457975

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.10.2007 at 02:36PM PDT, ID: 19458015

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.10.2007 at 03:30PM PDT, ID: 19458383

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 04:45PM PDT, ID: 19458762

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Visual Studio .NET 2005
Tags: textbox, format
Sign Up Now!
Solution Provided By: Priest04
Participating Experts: 2
Solution Grade: B
 
 
[+][-]07.10.2007 at 08:06PM PDT, ID: 19459631

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32