Results 1 to 3 of 3

Thread: Checkbox used for data input

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4

    Question

    I am teaching myself about databases through alot of books.
    But most of these books are running everywhere and anywhere that ulyimately leads nowhere. Thus I need your help.
    I want to use checkboxes that when checked will add data to the appropriate column. For example: if the box is checked I would like the field to be populated with text that I choose (such as an option like "cd player", and as I am scrolling through the recordset, If the field is populated with the appropriate text, I want the checkbox to be checked to indicate the store has a cd player. I have been getting "true", or when I adjust the code to get the result I want I get an error that the databound control cannot load (wrong type). I have it set for text and have tried everything else. I apologize if I have not given enough info for you to help me. But possibly it could be a start. Thank you for any help you can give.

  2. #2
    New Member
    Join Date
    Sep 2000
    Location
    Palmerston North, New Zealand
    Posts
    3

    Talking

    It seems fairly straightforward. Try doing it this way:

    In the code that runs behind the checkbox:
    If the Checkbox is True Then
    Find record with the recordset
    Assign the feild in the database (with the value in the textbox)
    Else
    Do nothing
    End If

    I know i haven't been very descriptive, but essencially what u have to do is to once the checkbox is clicked, search for the record with the recordset and assign the feild with the value u want.
    Eg.
    rstSensor!Item = "CD Player"

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4

    Red face

    I had already done all that, yet it is not working correctly.
    Maybe I need to explain further. Let me try to go step by step;

    - There will be a series of checkboxes on my program that can be used to enter several "set" descriptions of an item.
    - For each description, if the checkbox is selected, the database field will be filled with all that are selected.
    - I had it set up to where when the checkboxes are selected, the field was to be filled with the series of descriptions. BUT I am using the same interface to also browse the database info.
    - So what is happening is that the info selected will populate the field then when it is scrolled through it either changes the field info to "true" or the field cannot be bound. (Type mismatch)
    - IF I were descibing a car radio for instance. I would have selected: Am/fm, cassette, cd player and then each column (amfm, cassette, cdplayer) is filled with the value "true" or if I change it to state "cd player", I get a type mismatch when trying to scroll through the recordset.
    (if it binds to it at all).
    - The program is to be an easy way to fill out a description of a set product. Then the program is also to be used to scroll through the database to indicate what extras the product has.
    The real problem "appears" to be that I cannot have the databound control (checkbox) to be used for both input and for viewing.
    Since the checkbox is using values -1, 0, and 1
    there seems to be a reason it sends a boolean value to my database "true" or "false".
    If I adjust the code, I can get it to enter am/fm, but then when I reload the program it does not bind to the field.
    Sorry about being so long-winded about this. AS you can see, it is somewhat difficult for me to explain.
    Thanks for trying to help though!

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