Change RecordSource/Filter on active SubForm?

Stubster

New Member
Joined
Sep 19, 2014
Messages
2
Hello,
I am using Access 2007 and have a database that has a form utilizing a combobox [QueryData] to allow the user to select a record to view/edit. The data in [QueryData] is the result of a UNION, so the location of the record to view/edit could be on one of a couple different tables.

The problem I am having is that this form uses its subform as the view/edit window for the record. The subform is not visible until the user selects a record and then the "View" button. I have not been successful in changing the RecordSource and/or the Filter for the subform. I've tried...
Code:
Private Sub btnView_Click()
        Me!View.Form.RecordSource = "Jobs"
        Me!ViewEntry.Form.Filter = "JobID=Forms!Review_Form!QueryData.Value"
        Me!ViewEntry.Requery
        Me!ViewEntry.Form.Visible = True
End Sub
Any assistance would be awesome!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Nevermind. I figured it out. I just put the entire SQL in the RecordSource and skipped the Filter.
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top