Results 1 to 3 of 3

Thread: checkbox value: how to detect

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84

    checkbox value: how to detect

    Hi guys,

    I'm having a form in which the user can check a checkbox.

    Depending on the value (checked or not) an sql string must be constructed which looks in an access 2000 database to find items (tblCD_detail.Active) who have a corresponding value.

    I tried the following code to detect the state of the checkbox in the form:

    If Me.CheckBoxActive.CheckState.Checked = CheckState.Checked Then
    strSQLzoeken = strSQLzoeken & " and tblCD_detail.Active= true"
    Else
    strSQLzoeken = strSQLzoeken & " and tblCD_detail.Active= false"
    End If

    I don't get building errors but the code doesn't work properly because I dont get the expected results.

    I think it has something to do with the code or the way I talk to the values in the database.

    Can somebody help me?

    Thanks

    Tom

  2. #2
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    try using 0 and 1 instead of true or false
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  3. #3
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    oh with your search forms thing

    nice way to deal with it is

    formSearch have just a designed form there and when press the find button set the inputted value into a module

    ie MyModuleVar = me.txtInput.text

    then you just open second form as normal
    onload event contains your sql and getting the input from the module var hey presto easy
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

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