Conditional Formatting

M

Marc T

Hi All,

here's the current problem:

I have a form with a tab control which itself shows four instances of the
same subform (with different recordsets).

I've currently got the following expression for conditional formatting:

[Forms]![frmMainBrowse]![frmMainComboBox]![frmData]![DT_PLANNED_START]<>" "

This works great if you're only using the one tab, but if you move to
another the conditional formatting still refers to the first tab.
Is there any way to set the expression to only refer to the particular tab
you're on? Only other way I can think is to duplicate the subforms....

Thanks as always,
Marc
 
B

BruceM via AccessMonster.com

What are you referencing? You seem to have referenced a combo box on the
main form, but then you have frmData and DT_PLANNED_START. Also, it looks as
the formatting will occur if the data being checked is anything other than a
single space. But maybe you posted it that way in an attempt to simplify the
actual situation.

I'm not sure what you mean by several different recordsets. I assume you
mean several ways of sorting the same data, or some such thing. I don't see
how one form could have multiple recordsets at the same time. You may be
able to get what you want by setting the subform's recordset when you click a
tab page. You can use code to identify the current tab page:

Me.tabPageName.Pages(Me.tabPageName.Value).Caption

The above should reference the caption property of the current tab page.
This may be more than you need. You should be able to do something like this
in the tab control's Change event:

Select Case Me.tabPageName
Case 0
Me.[SubformControlName].Form.Recordsource = "Query1"
Case 1
Me.[SubformControlName].Form.Recordsource = "Query2"
Case 2
Me.[SubformControlName].Form.Recordsource = "Query3"
Case 3
Me.[SubformControlName].Form.Recordsource = "Query4"
End Select

Pages are numbered starting with 0.

Maybe you could put the query name as the Tag property for the tab page, and
set the record source thus (again, in the tab control's Change event):

Me.RecordSource = Me.[SubformControlName].Pages(Me.SubfromControlName).Tag


Marc said:
Hi All,

here's the current problem:

I have a form with a tab control which itself shows four instances of the
same subform (with different recordsets).

I've currently got the following expression for conditional formatting:

[Forms]![frmMainBrowse]![frmMainComboBox]![frmData]![DT_PLANNED_START]<>" "

This works great if you're only using the one tab, but if you move to
another the conditional formatting still refers to the first tab.
Is there any way to set the expression to only refer to the particular tab
you're on? Only other way I can think is to duplicate the subforms....

Thanks as always,
Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top