A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

1 Form with 2 inputs for 2 tables



 
 
Thread Tools Display Modes
  #1  
Old July 16th, 2009, 05:06 PM posted to microsoft.public.access.forms
-Karl
external usenet poster
 
Posts: 15
Default 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  
Old July 16th, 2009, 05:52 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old July 16th, 2009, 09:38 PM posted to microsoft.public.access.forms
-Karl
external usenet poster
 
Posts: 15
Default 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  
Old July 16th, 2009, 09:43 PM posted to microsoft.public.access.forms
-Karl
external usenet poster
 
Posts: 15
Default 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  
Old July 16th, 2009, 10:06 PM posted to microsoft.public.access.forms
-Karl
external usenet poster
 
Posts: 15
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.