Full Version: Stuck on subform refresh
UtterAccess Forums > Microsoft® Access > Access Forms
Hi all,
I've looked through a few posts, and can't seem to find what I need.
Here's the situation:
I have a main form with a subform that is a continuous form. The subform dataset is based upon a query
I have a combobox on the main form that I would like to give three options, and on the afterupdate event have a Select Case statement edit the sql string to the query that the subform uses based upon the selection of one of these three options. When the query gets updated, I want to view the changed subform on the main form.
No matter what - I can't get this to work. I know that the base query gets updated, because I can open the subform and see that it opens with the current data in the base query. I just can't seem to update the view of the subform in the main form.
I'm currently using the following with no success:
--- Me.sfrmFCTransactions.Form.Requery
One reason the the child/parent link does not seem to be an option is due to the fact that my combobox choices are a value list of items that don't relate to particular values in the query ---- i.e. selection 1 is "Open Items", which changes the query sql string parameter to "WHERE IsNull(BillingFlag) "
Any suggestions?
Just reset the recordsource of the subform.
e.sfrmFCTransactions.Form.Recordsource = "queryName"
That will force it to go out and grab the query and re-evaluate it.
Thanks for the response, Rob. I'll try that when I get back in the office. I knew there was something simple.
Is a workaround yesterday, I made a Function on the subform that would remove, then reassign the recordsource (the query) on the subform. I called that function from the main form when the combobox was updated. I'll try your suggestion on Monday and let you know how it goes.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.