Database Query

Results 1 to 2 of 2

Thread: Database Query

  1. #1
    JoAnn :-) Guest

    Default Database Query

    How would I query a database (Access) using first a text box to select a record name (like Intel) and then with check boxes, return the corresponding field values of those boxes that have been checked? (ie I select a "Company Name" by inserting their name in a text box, then I select corresponding fields from that record by selecting check boxes) I posted this message yesterday but the responses only gave me a little code and they assumed I know much more that I do. Could some one please show me the entire code! I&#039;m trying to learn. I&#039;ll love you forever!!! Any help will be greatly appreciated. <BR>JoAnn :-) <BR>

  2. #2
    Join Date
    Dec 1969

    Default Forever???

    So you have your text box for the look up, <BR><BR>Then you create your checkboxes, either dynamically or statically.<BR><BR>on your form handler you will have your sql query<BR><BR>Select " table.CompanyName,<BR> if Request("boxname")="Yes" then &#039; if you set the value to yes<BR> size,<BR> end if <BR> if Request("boxname2")="Yes" then &#039; if you set the value to y<BR> weight,<BR> end if <BR>From table<BR><BR>Where companyname = &#039;"&Request.Form("CompanyName")&"&#039;;"<BR>< BR>the syntax may not be 100%, but hopefully this may be what you need. <BR><BR>Also, Always response.write your sql statements before you attempt to open your recordsets, this will let you see the exact query that you are passing in your sql statement and it will avoid most of the "missing parameter, expected 1" type errors.<BR><BR>mj<BR>

Posting Permissions

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