Hi,
I have a subform whose RecordSource I want to be an SQL statement that selects only records from the Tasks table where the TaskType field matches the caption of the active page of the main form's tab control. In other words, I have a main form with a tab control with several pages, and I want the subforms on each page of the tab control to select only records whose TaskType field matches the name of that page of the tab control.
I'm having trouble with the syntax, I think. Here's what I have:
Can anyone help me out? :)
Thanks!
CB55
I have a subform whose RecordSource I want to be an SQL statement that selects only records from the Tasks table where the TaskType field matches the caption of the active page of the main form's tab control. In other words, I have a main form with a tab control with several pages, and I want the subforms on each page of the tab control to select only records whose TaskType field matches the name of that page of the tab control.
I'm having trouble with the syntax, I think. Here's what I have:
Code:
SELECT Tasks.* FROM Tasks WHERE ([Tasks].[TaskType])=[Forms]![Tasks].[TabControl].[Pages(0)].[Caption];
Thanks!
CB55
Comment