Adding record to MDB

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Adding record to MDB

    I have a problem with adding a record to my MDB database. I know how to add
    products, but as soon as I use a checkbox to add "selected" or "not
    selected", I get the message "Error desc. -> [Microsoft][ODBC Microsoft
    Access Driver] Data type mismatch in criteria expression."

    How do I add a checkbox value into my MDB database ? I have chosen a
    "YES/NO" value to my field, and the rest of the fields worked before adding
    this checkbox.

    Best regards
    Leif


    Leif Hauge Guest

  2. Similar Questions and Discussions

    1. Adding record
      I have a database the I add a new candidate in and as you're adding the information for the candidate other boxes pop up to add deatils (personal...
    2. Stop adding record in subform after record count = 1
      Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the...
    3. Adding a new record when the record source is a query.
      Hello All, I have a form that runs a query. The reason it runs on a query is because prior to it opening I have a form from which you can pick...
    4. Adding record to a MYSQL DB using PHP ?
      What is the best way to add a new record to a MYSQL DB using a FORM and PHP ? Any examples or URLS ? Thanks
    5. adding a new record with code
      Access 97 ,win98SE. I have a form (myform) with a subform(mysf). myform has a combo box which looks up a client and then displays that client...
  3. #2

    Default Re: Adding record to MDB

    >> The error is on line 8
    > How do you know? I didn't post any code
    Exactly!

    Cheers
    Ken


    --
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "Leif Hauge" <leif76@online.no> wrote in message
    news:%236b$rQFRDHA.3796@tk2msftngp13.phx.gbl...
    : I have a problem with adding a record to my MDB database. I know how to
    add
    : products, but as soon as I use a checkbox to add "selected" or "not
    : selected", I get the message "Error desc. -> [Microsoft][ODBC Microsoft
    : Access Driver] Data type mismatch in criteria expression."
    :
    : How do I add a checkbox value into my MDB database ? I have chosen a
    : "YES/NO" value to my field, and the rest of the fields worked before
    adding
    : this checkbox.
    :
    : Best regards
    : Leif
    :
    :


    Ken Schaefer Guest

  4. #3

    Default Re: Adding record to MDB

    Mosley wrote:
    > "Leif Hauge" <leif76@online.no> wrote in message
    > news:%236b$rQFRDHA.3796@tk2msftngp13.phx.gbl...
    >> I have a problem with adding a record to my MDB database. I know how
    >> to add products, but as soon as I use a checkbox to add "selected"
    >> or "not selected", I get the message "Error desc. ->
    >> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in
    >> criteria expression."
    >>
    >> How do I add a checkbox value into my MDB database ? I have chosen a
    >> "YES/NO" value to my field, and the rest of the fields worked before
    >> adding this checkbox.
    >>
    >> Best regards
    >> Leif
    >>
    >
    >
    > don't use 'yes no',
    >
    > use a text field,
    >
    > a check box enters the word 'on'
    Not necessarily. A checkbox either returns the word "on", or whatever word
    you have set its value property to.
    > into the database or nothing if it
    > is not checked.
    You can use a checkbox. Just use an If statement to process the user's
    input. If the user checked the box, then its value will have a length
    greater than 0:

    Dim ChkBoxValue
    ChkBoxValue=request.form("CheckBox")
    If len(ChkBoxValue) > 0 then
    ChkBoxValue = -1
    else
    ChkBoxValue = 0
    end if

    Now pass the value contained in ChkBoxValue to your SQL statement.

    HTH,
    Bob Barrows


    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139