CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Checkbox value

  1. #1
    Join Date
    Feb 2009
    Posts
    192

    Checkbox value

    Hi,

    Why when I click the checkbox and submit it stills submit a False value?

    Thank you

    Code:
    Try
                query = "UPDATE TblChangeControlDet SET PeerRvwApp=@PeerRvwApp WHERE ChangeID=@ChangeID"
                cmdC = New SqlCommand(query, conn)
    
                cmdC.Parameters.AddWithValue("@PeerRvwApp", chkpeer.Text)
    
                cmdC.ExecuteNonQuery()
    
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Information, "CCMS")
            End Try
    ote: chkpeer is the name of the checkbox..

    Thxs

  2. #2
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: Checkbox value

    .Text is not the value for the checkbox.

    Use the .Checked or .Value property

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Checkbox value

    It will give the name of the LB. Need a number()

    Code:
    chkpeer(31)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured