Visitor data input form

G

Guest

I have a geodatabase with city, state, and coordinate info. I want to be able
to enter the state on the input form and have the cities in that state
selected to be available in the city field. Example: if I want to enter
information for a visitor from Paris, TN, I would enter TN in the state field
and I would have a dropdown in the city field that would only show cities in
TN to pick from where I could select Paris. Now I enter TN and enter Paris
but I get the geodata from the first city named Paris in the database which
could be Paris, TX not Paris, TN.
Or I could set the form up the other way. Enter the city first and then have
only the states with a city of that name show up in the dropdown for state
field.
I just don't know enough about forms.
 
F

fredg

I have a geodatabase with city, state, and coordinate info. I want to be able
to enter the state on the input form and have the cities in that state
selected to be available in the city field. Example: if I want to enter
information for a visitor from Paris, TN, I would enter TN in the state field
and I would have a dropdown in the city field that would only show cities in
TN to pick from where I could select Paris. Now I enter TN and enter Paris
but I get the geodata from the first city named Paris in the database which
could be Paris, TX not Paris, TN.
Or I could set the form up the other way. Enter the city first and then have
only the states with a city of that name show up in the dropdown for state
field.
I just don't know enough about forms.

Set the List box RowsourceType property to Table/Query.
Leave the RowSource property of the List Box blank.
Code the [State] AfterUpdate event:

Me!ListBoxName.RowSource = "Select [TableName].[City] from [TableName]
where TableName.State = '" & Me![State] & "' Order By [City] ;"
 

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