Results 1 to 2 of 2

Thread: checkbox

  1. #1
    Young Guest

    Default checkbox

    Hi, helper! I have a checklist that the user going to check off. What I want is that when the user checks off the check box, the database will automatically update the check list at the same time. And also, users should be able to see the result of their checklist when they want to see on the web page. I am using Access bty. Each field data type is Yes/No. So when the user clicks off the check box, then the field that matches with the list will be generated with yes. <BR><BR>1.My problem is what property I should use to find out which field got checked off from the database when it displys on ASP page.<BR><BR>2.Another one is that whick property tells the database to update the field to say Yes or No. SQL statement using UPDATE would be the appropriate way, you think?<BR><BR>I hope it makes sense to you. Please help me!

  2. #2
    Margaret Widholm Guest

    Default RE: checkbox

    Ok, this might be a little tricky to explain, but I&#039ll give it a shot. You need to have different names for the individual users so their record set will be unique from the others, let&#039s call that field "ID". Let&#039s say John Doe fills out your checklist. Say you name your checkboxes a, b, and c. Now, the first time he hits the submit button, you need to pass the data using the request.form commands. Then use an append query in sql to add the record. Access will write the sql for you, which is nice, but the sql will look something like this: <BR><BR>sql="INSERT INTO table_name ( ID, a, b, c ) SELECT &#039" & ID & "&#039 as ID, &#039" & a & "&#039 as a, &#039" & b & "&#039 as b, &#039" & c & "&#039 as c;"<BR><BR> After that, when they come back in, have them fill their name in, then run an sql select query, something like this: <BR><BR>sql="SELECT table_name.ID, table_name.a, table_name.b, table_name.c FROM table_name WHERE (((table_name.ID)="John Doe"));"<BR><BR> Now that you have your select statement, you have the values from the fields. Use the same html for the checklist, but in the tags for each field put value=&#060;%=a%&#062; or value=&#060;%=b%&#062; and this should populate the fields how they have them. <BR> Now, I figure this is enough to gnaw on for now. If you have questions, I check in here pretty often, so I&#039ll keep an eye out. Also, do you want them to be able to change their checklist later? That will involve a bit more... Good luck!

Posting Permissions

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