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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting/Retrieving data on a Form

Status
Not open for further replies.

neszz

Technical User
Apr 27, 2004
17
US
Hi! I have a question regarding retrieving recor from a query onto a form. Here are the details what is going on.

I am collecting information regarding properties. It contains the property owners information (Name, Phone Number, etc), property information (State, County, City, sqft, etc.), Loan information, etc. All of this information was collected from a form called frmProperties. All that information is stored in a query.
In that query, I sorted all data entry from County, City, Adress, and name. Everything looks good.

Here is what I am having trouble with. There is another form in my database for editing properties. Just in case the person entering data messes up or needs to change some information. My question is how do I retrieve the data in the sorted order. I even tried to make it is easier by the user by placing the existing combo boxs onto the form to limit the searching. I hope I make some sense here.

I drag the combobox, County on the form. So the user would first select the county the property is located at. Then I want to drag the text box City so that it would interact. They then type in the city and it sorts and retrieve the data from the query from that. Right below the combo box and text box, I would have a sub form of the records. So when they click on the combo box for the specific county, it would only show that county selected. Then the text box would be used to limit the searches for the specific city.

I guess I can change my question to, how do I interact the combo box to the subform in retrieving the right data? I tried to search forums but I could not find the right one that fits this project. Any suggestions?

neszz
 
i think ur question is how to get the details in the subform according to the country field u selected.

assuming ur
table name is table1
form name form1
subform name subfom1
country field name coun(in the table)
country combo field in form1 named as countrycombo

ur answer can be
in the after update event procedure of countrycombo

select * from table1 where coun=forms![form1]![subform1]![countrycombo] orderby fields;
 
in the aterupdate event procedure add this too
form1!subform1!recordsource="select * from table1 where coun=forms![form1]![subform1]![countrycombo] orderby fields;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top