how to fill yes/no field ms-access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gudipati
    New Member
    • Oct 2007
    • 21

    how to fill yes/no field ms-access

    hi

    check box is giving me string trouble form every thing is fine.except check box every thing is storing in database.what r the needs to store checkbox field.in disign view i have taken the format---yes/no (insted of true/false,on/off)is there any need to set default value at design view.i think prm is with this regards pl kindly rectify me.

    my code::

    if current = "on" then
    current = 0
    else
    current = -1
    end if
    sqlinsert = "insert into visitations(sal utation,lastNam e,middleName,fi rstName,postNam e,dateBorn,date Expired,cemetar yDetails,Visita tionDetails,Ser vicesDetails,cu rrent) values('" & request("radiob utton") & "','" & lastName & "' , '" & middleName & "', '" & firstName & "','" & request("rbpost name") & "','" & dateBorn & "','" & dateExpired & "','" & cemetaryDetails & "' ,'" & VisitationDetai ls & "','" & ServicesDetails & "','" & current & "')"


    check box:::<input name="current" type="checkbox" id="current">

    is there any need to take value.i tried from all corners.but i couldn't get.pl solve my prm.
    thank u
  • markrawlingson
    Recognized Expert Contributor
    • Aug 2007
    • 346

    #2
    -1 = Yes/on/true
    0 = No/off/false

    So you're saying if the checkbox IS checked, set the yes/no field to no?
    That might be what you're intending, which is fine.. but I thought i'd point it out anyway.

    [CODE=ASP]
    if Request.Form("c urrent") = "on" then
    current = 0
    else
    current = -1
    end if
    [/CODE]

    You have to request the information from the form, you were checking a variable name called "current" for the value of "on" - which probably wasn't set as on anywhere in your code.

    You may also wish to read this post.

    Sincerely,
    Mark

    Comment

    Working...