1 Form with 2 inputs for 2 tables

K

-Karl

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
 
K

-Karl

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.
 
K

-Karl

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.
 
K

-Karl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top