A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional Formatting



 
 
Thread Tools Display Modes
  #1  
Old November 8th, 2009, 03:48 PM posted to microsoft.public.access.forms
Marc T
external usenet poster
 
Posts: 35
Default Conditional Formatting

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
  #2  
Old November 9th, 2009, 01:51 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Conditional Formatting

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 T wrote:
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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.