We help IT Professionals succeed at work.

Query Ouput

Last Modified: 2012-06-27
hello all,

I have a very simple MS Access 2010 database and I have table that is call "code", this table have 5 fields:

Each of them have a differente values for example, Code1 is that one that have the code number, Code2 have the name, Code3 the address, code4 the city code5 the zip code.

so I have a query where I can search by Code1 and I get all the results, my problem is, how can i put my result on a form, what i need is from a form the user selecting the Code (Code1) and it wil automatically populate the other 4 (code2 thru code5) and the information will need to be save into a table.

any ideaS?

Watch Question

Scott McDaniel (EE MVE )Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014

Build a form based on your query. This will show the values in the Query.

To filter that query, you can do several things. You can include an unbound Textbox on the form and filter by that. An "Unbound" textbox is one that has no controlsource. To use that, you can add code like this in the AFterUpdate event of that textbox:

Sub MyTextbox_AfterUpdate()
  Me.Filter = "Code1=" & Me.MyTextbox
  Me.FilterOn = True
End Sub

The above code would filter the form based on the value you input into the textbox, so if you want to view the data for code # 123, then just enter "123" in the textbox and tab out of the box (or add a Button and use the Click event of the button).
Top Expert 2009
This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.