Untalented's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
136 (0.14 per day)
Joined:
31-January 12
Profile Views:
875
Last Active:
User is offline Sep 16 2014 10:00 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   Untalented has not set their status

Posts I've Made

  1. In Topic: Datagrid "Index was out of range"

    Posted 16 Sep 2014

    Hi, I got it. It's the cell that's causing the problem.

    Thanks DIC
  2. In Topic: Datagridview Update Value

    Posted 15 Mar 2014

    This is inside my button, the problem might be here

      Dim updatePayment As Integer = Val(lblAmount.Text) - Val(txtBalance.Text)
    'lblAmount is binded to Amount column
    
            If Val(txtBalance.Text) = Val(lblBalance.Text) Then
                'lblBalance.Text = "0"
                lblZeroHolder.Text = 0
    'I tried to add another txtbox to hold the zero value because I think the lblbalance which is binded
    'to balance column is causing the problem but it didn't resolve the issue.. somewhere is equivalent to zero
    'that is causing my loop to react.. im not sure
    
                BindingSource.EndEdit()
                InvoiceTableAdapter.Update(DBDataSet.Invoice)
                InvoiceTableAdapter.Fill(DBDataSet.Invoice)
                MsgBox("Payment Updated", MsgBoxStyle.Information)
    
    
    
                txtBalance.Text = ""
                txtBalance.Focus()
    
    
                'UPDATE TIME
                lblChangeDate.Text = DateTime.Now
                BindingSource.EndEdit()
                InvoiceTableAdapter.Update(DBDataSet.Invoice)
    
    
                'Me.DGVInvoice.CurrentCell = Nothing
                Exit Sub
            End If
    
    
    
            lblBalance.Text = updatePayment
    
            BindingSource.EndEdit()
            InvoiceTableAdapter.Update(DBDataSet.Invoice)
            InvoiceTableAdapter.Fill(DBDataSet.Invoice)
            MsgBox("Payment Updated", MsgBoxStyle.Information)
    
    
    
            txtBalance.Text = ""
            txtBalance.Focus()
    
            'UPDATE TIME
            lblChangeDate.Text = DateTime.Now
            BindingSource.EndEdit()
            InvoiceTableAdapter.Update(DBDataSet.Invoice)
            'Me.DGVInvoice.CurrentCell = Nothing
        End Sub
    
    
  3. In Topic: InputBox Validation

    Posted 10 Mar 2014

    Thanks for the replies :) I used windows form and a textbox as alternative to inputbox so I have better control

    Thanks again :^:
  4. In Topic: Crystal Reports produced problems in VB

    Posted 8 Mar 2014

    Thanks :^:
  5. In Topic: Number Format Problem

    Posted 8 Mar 2014

    View PostMinimalist, on 08 March 2014 - 08:50 AM, said:

    Did you try my code? It will convert the string correctly to a decimal. It would have been better to sort your code before changing your data types without sorting the problem first. Also your sentences: "Something is not updated. I can still input numbers with decimal, but it still drops the decimal." doesn't make sense to me.


    Hi, I haven't tried your code yesterday because I might run again with so many complications so I tried to simplify it by just changing my data type to "text" because as far as I know, everything will be accepted if the data type is "Text" on Access

    Sorry about this

    Quote

    Something is not updated. I can still input numbers with decimal, but it still drops the decimal.


    Quote

    Something was not update

    I think somewhere in the compiler, or xsd etc was not updated when i change the the srp data type from "Number" to "Text"

    Quote

    I can still input numbers with decimal, but it still drops the decimal

    After changing my Access Database data type from "Number" to "Text" and trying to input numbers, I still get the same result as it drops the decimal or round it off

    Ex. 123.8 output is 124



    View Postthecoat, on 08 March 2014 - 12:14 PM, said:

    View PostUntalented, on 08 March 2014 - 02:03 AM, said:

    Im using

    Dim srp As Decimal = Decimal.Parse(txtSRP.Text)
    Meat.ProductTableAdapter.Insert(txtName.Text, srp, ComboType.Text)
    
    


    Database: MS Access 2007
    Data Tyoe: Number
    Field Size: Double
    Decimal Place: 2

    Entered Value 123.8
    Output 124



    So if you put a break on line2 and in the immediate or watch window check the value of srp just before the insert what does it have (decimal or truncated value)?

    Later on you posted a screen shot with the SRP column with the datatype property system.string. I'm not sure if this was before or after you changed your database for trying text, but that datatype property is important to avoid unintended implicit conversions.


    I don't know how to use the break, probably you're talking about the "debugging" where you can see the number stored in the variable as the program runs. I will try to search again for that tutorial, I think I really need that.

    Quote

    I'm not sure if this was before or after you changed your database for trying text, but that datatype property is important to avoid unintended implicit conversions.

    This was after I changed it to text.


    Thanks :surrender:

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Comments

Untalented has no profile comments yet. Why not say hello?