If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
1 Form with 2 inputs for 2 tables
I am wondering how I can go about this. I have 1 form with 2 inputs
that a user will fill in (i.e. State and County). Here is what I am trying to do. 1) Once the user selects the State, the Country dropdown list would auto populate the counties per the state. However, my ONChange command doesn't work on the State dropdown. I need to pull the ID out of the state table. I've looked into macros which I don't believe would work. So I was looking into coding the event but alas, I am not sure how to go about this with SQL commands. I have been looking online for some examples but nothing yet. Thank you for helping me. I'm pulling out my hair. Table State ---------------------- ID State 1 Florida 2 Texas Table County --------------------------- ID StateID County 1 2 pinellas 2 1 polk Table User ----------------------- ID User StateID Country ID 1 ted 1 2 2 sue 2 1 |
#2
|
|||
|
|||
1 Form with 2 inputs for 2 tables
Search on Cascading Combos.
-- Build a little, test a little. "-Karl" wrote: I am wondering how I can go about this. I have 1 form with 2 inputs that a user will fill in (i.e. State and County). Here is what I am trying to do. 1) Once the user selects the State, the Country dropdown list would auto populate the counties per the state. However, my ONChange command doesn't work on the State dropdown. I need to pull the ID out of the state table. I've looked into macros which I don't believe would work. So I was looking into coding the event but alas, I am not sure how to go about this with SQL commands. I have been looking online for some examples but nothing yet. Thank you for helping me. I'm pulling out my hair. Table State ---------------------- ID State 1 Florida 2 Texas Table County --------------------------- ID StateID County 1 2 pinellas 2 1 polk Table User ----------------------- ID User StateID Country ID 1 ted 1 2 2 sue 2 1 |
#3
|
|||
|
|||
1 Form with 2 inputs for 2 tables
Awesome. Now I have another question. I want to be able to use Input
boxes where the user is able to Input data. Same theory as before with the tables. But now after they fill in both fields and submit the data, how would I be able to link the 2 tables (State and county)? I am guessing that I would need to INSERT the state data, then run a SELECT query to pull the ID out. If so, how would I assign the ID to a variable or whatever so that I can inject the ID into the County table? I am guessing that once I am able to assign the ID to a variable, I would run a SQL command to iINSERT into the county table values [variable], country name ?? I hope I made sense. On Jul 16, 12:52*pm, KARL DEWEY wrote: Search on Cascading Combos. -- Build a little, test a little. |
#4
|
|||
|
|||
1 Form with 2 inputs for 2 tables
Awesome. Now I have another question. I want to be able to use Input
boxes where the user is able to Input data. Same theory as before with the tables. But now after they fill in both fields and submit the data, how would I be able to link the 2 tables (State and county)? I am guessing that I would need to INSERT the state data, then run a SELECT query to pull the ID out. If so, how would I assign the ID to a variable or whatever so that I can inject the ID into the County table? I am guessing that once I am able to assign the ID to a variable, I would run a SQL command to iINSERT into the county table values [variable], country name ?? I hope I made sense. On Jul 16, 12:52*pm, KARL DEWEY wrote: Search on Cascading Combos. -- Build a little, test a little. |
#5
|
|||
|
|||
1 Form with 2 inputs for 2 tables
Awesome. Now I have another question. I want to be able to use Input
boxes where the user is able to Input data. Same theory as before with the tables. But now after they fill in both fields and submit the data, how would I be able to link the 2 tables (State and county)? I am guessing that I would need to INSERT the state data, then run a SELECT query to pull the ID out. If so, how would I assign the ID to a variable or whatever so that I can inject the ID into the County table? I am guessing that once I am able to assign the ID to a variable, I would run a SQL command to iINSERT into the county table values [variable], country name ?? I hope I made sense. On Jul 16, 12:52*pm, KARL DEWEY wrote: Search on Cascading Combos. -- Build a little, test a little. |
Thread Tools | |
Display Modes | |
|
|