Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic fills for fields on a form

Status
Not open for further replies.

taylornow

Technical User
Oct 16, 2000
90
US
Wow- say the subject line real fast three times ! I have a question about automatic fills. I cannot seem to correctly type the criteria or I am just not attempting the problem the right way. Here goes-

The form has a field to enter in the city. I have a table that has the city name, county name, and region already there. Is there a way to set up the county and region fields to automatically put in the corresponding data when the city is entered in ?

Thanks in advance.

Taylor
 
Use the Northwind or Nwind sample from Microsoft. Go to Orders form and look at that code. Northwind is on the office CD or you can download.
 
That is where I have been. The Distinct Row formula is getting to me ! Is that even the correct example of what I need to do ? The example is confusing to me. Put it on the form or on the tables the info comes from ? DLookUp? Or am I just making this too hard ??????

Thanks
Taylor
 
You may have to follow the thread of the formula which goes in the form. I am out of town and the computer doesn't have Access on it. Orders Form is base on Orders Qry. I believe Access just knows when the CustomerID is chosen to fill in the other fields. The Ship To is from the After Update Event of CustomerID. I'll be back home in two days.
 
For this type of thing I like to use a combo box and a textbox set the combos rowsource to select city,county,region from yourtablename
set the combobox column count to 3 and set the colunm widths to 1.5";0";0" name the textbox txtcity now set the textbox control source to =[txtcity].column(1) & " " & combo1.column(2) now when you select a city from the drop down the count and region will fill in automatically in the text box
 
I was afraid that I would have to make a combo box. I was trying to cut corners for them and I don't think I can. The problem with the dropdown idea is there are close to 600 cities they could choose from ! Maybe they will just have to enter the city and I can use a combo box for the county and have the region fill it. I will give it a go. Thanks so much for everybody's help. If you think of anything else- just email me !

c ya
Taylor
 
RE: 600 cities in the combo box. Check the help file for a definition of the AutoExpand property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top