Refreshing subform within form

BigJimSlade

Registered User.
Local time
Today, 23:05
Joined
Oct 11, 2000
Messages
173
I have a subform that is not bound to my form. However, the subform's source object is a query that is executed by my form combo box. I would like to refresh the subform while still in form view. I tried .requery for the subform, but it did not work. What should I do?

Jim
 
On the AfterUpdate of the combo box you could try...
Forms!FormName!SubFormName.Refresh
Chris
 
I had the same problem with my form and one of the helpful souls here suggested I use

Me.Requery in the AfterUpdate property

It worked in my case, hope it works for you.
 
Hey Chris!

Thankyou for the advice, but it did not work. What could be preventing my subform from showing the current query? If I close out and reopen the form, the data is accurate.

Thanks again, Jim

[This message has been edited by BigJimSlade (edited 10-11-2000).]
 
BigJim (if that really is your name)
I don't have a lot of experience with unbound sub forms, however you might try to put the name of your combo box in the criteria line of the matching field of the Query. Say your sub form displayed employee information. The Query might be selecting fields like emp_no, emp_name, emp_address etc. The Combo box on your form would have a SELECT query as it's recordsource that Selected emp_nos and Emp_names but only displayed the names. In the emp_no field of the query you would have a criteria of ...
=[Forms]![FormName]![ComboBoxName]
Then you go ahead with the call to requery or refresh the subform (either should work). Thereby the Query is called using the current value of the Combo Box.
I think that should work
Chris
 
If the subform and main form have the same field i.e. your combo box pulls up a value that is shown in the subform you could then (I think) click on the subform and link child to Master.

I'm very inexperienced at this game but managed to achieve what you are after by doing just that.

Hope if helps
 
I wanted to thank everyone for their suggestions. You have all been a great help.

Big Thanks from Big Jim!
 

Users who are viewing this thread

Back
Top Bottom