Refresh values in a form according to a query

unknown2u

Registered User.
Local time
Today, 12:46
Joined
Oct 16, 2013
Messages
46
Hey,

I have a form that has a dropbox list and I want the values of the form to change according to the value in the dropbox.

For example:

When the dropbox contains the value A,
The form would display x=1, y=2, z=3.

When the dropbox contains the value B,
The form would display x=4, y=5, z=6.

I managed to create a query that opens the QUERY's results according to the value in the dropbox but I can't managed to run the query in the form, return the values according to the query and display them in the form.

I searched the internet and found many options including the Dcount command but I don't think it fits my case...
I know I have to write something in the AfterUpdate field of the dropbox but I just can't figure out what it is...

Please help :)
 
if you want to refresh your form (to rerun the query) you are looking for Me.Refresh
 
Read my post.. I know how to just refresh the form... I need different results depending on the value of an element...
 
Thanks... but it's still not what I'm looking for...

I'm sure there's a much more simple way to do what I want...

Please help me...
 
SOLVED!

After some trial and error... all that is needed is to add the "Requery" macro to the AfterUpdate of the dropbox.

Thanks anyways!
 
My link said:
In order to have the State and City Combo Boxes updated to reflect changes in the value contained in the Country Combo Box, it's necessary to invoke the Requery method for the two Combo Boxes in a procedure called from the AfterUpdate event of the Country Combo Box.
Glad you got it working anyway. :)
 
Yeah I happened to come across that paragraph lol... problem is I first tried going through all the examples given in the post you sent but it became frustrating since I couldn't quite make the connection to my case.

But still I got the idea from that part and other posts I read :-)

Thanks man!
 
Yeah, Access Help and Forums can sometimes be a little bit like staring at one of those magic pictures until your eyes fuzz out and the image comes clear... :D
 

Users who are viewing this thread

Back
Top Bottom