Many-to-Many database help

Results 1 to 2 of 2

Thread: Many-to-Many database help

  1. #1
    Join Date
    Dec 1969

    Default Many-to-Many database help

    I am in need of some assistance with an Access database Web form. This is a form where a users information is displayed including the state they live in, then the user can add multiple states that they are willing to travel to. <BR><BR>In the database I have two tables, I have a table (REFERRAL) that includes a field for the State the person lives in. I added another table (REFSTATE) with the state they are working in as well as any states they will travel to. The two tables have a corresponding field (COMP_NO) for relationship.<BR><BR>I want the ability for a user to add themselves to multiple states for traveling. Some users will have multiple states while others will only have the state they are in. <BR><BR>The way I have it set up now is a page comes up with their data including their home state and states they would travel too. If they want to add states, press a button opening a new window to check (checkbox) any additional states they want to travel to. I have their current state already checked and disabled (since they will not uncheck that). Once they check the states they will travel to, press button to update the database, close the opened window, then refresh the original window. <BR><BR>My first problem is writing a function code to bring up the state they live (REFERRAL.STATE) in the &#039;pop-up&#039; window (with the state they are in to be checked and blocked so they cant change that) then have this function search the other table to find any additional states (REFSTATE.STATE) they previously checked. <BR><BR><BR>Thanks in advance. <BR>

  2. #2
    Join Date
    Dec 1969

    Default Thinking about it too hard...

    Why not just pass their primary key to the popup window and let *IT* find the REFERRAL.STATE *as well as* all the REFSTATE.STATE values?<BR><BR>And then, for the update based on the popup results, I would *WIPE OUT* all records from the REFSTATE table for this person and then add all the checkboxes that are checked. (It&#039;s either that or see this:<BR> )<BR><BR>And of course you can pass the PK as part of the URL that you use to open the popup with:<BR><BR> "popup.asp?pk=&#060;%=pk%&#062;", "POPUP", "...." );<BR><BR><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