Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with conditional formattingand Tab Ctrl

Status
Not open for further replies.

joel009

Programmer
Jul 7, 2000
272
0
0
US
Hi All, I have a form with a tab ctrl with 5 tabs that I want to highlight the entire row when any tab is selected. Each tab is a subform. On the main form I have a hidden txt box holding the Part Number value which is also on all 5 tabs in the tab ctrl. In the Form_Current event of each subform I have:
Forms!frmBaseRouteAssignment!txtCurPartNumber = Me.txtPartNumber
This work in selecting the same record on each tab ctrl. I want to highlight the enitire row. I have been playing with the Conditional Formating in the subforms and have one of the subforms working but not the last 4.Any suggestions on where to look?

Thanks!!!

Joel
 
The fields in the subform that you want to format should have conditional formatting as follows

expression is
[txtPartNumber] = [Forms]![frmBaseRouteAssignment]![txtCurPartNumber]

You may need a Me.recalc in the subform on current event to repaint the formatting
 
Using XP SP3 Access 2010 in 2007 mode. In the conditional formatting for each subform I have - [txtPartNumber]=Forms![frmBaseRouteAssignment]![txtCurPartNumber]. In the subforms Form_Current event I have -
Forms!frmBaseRouteAssignment!txtCurPartNumber = Me.txtPartNumber
Me.Recalc. It works on one form and I can't see any difference on the 4 other subforms. I moved the working subform to a different tab order in the tab control and the one form still works. All continuous forms.
Stumped I am.

Joel
 
Got it. I had the text boxes named different on 4 of the 5 subforms. As soon as I changed the call to [PartNumber]=[Forms]![frmBaseRouteAssignment]![txtCurPartNumber] it was working.

Thanks MajP

Joel
 
Not sure if you want to show all the other records on purpose, but normally you would want to only show the child records related to the parent part number. If you want that effect simply for each of the subform controls set the following properties

link master fields: [txtCurPartNumber]
link child fields: partNumber

when you change the text box on the main form, it will filter all the subforms to the current part number. That is a more traditional user interface. However, you may be doing comparisons where the user still needs to see information on the other "non-related" parts.
 
Showing all the other records deliberatly. User can select a PartNumber on any screen and see the related info on all the tabs,if record not avaliable the tab is blank. Also the user can select buttons from the header to Add/update/delete.

Any suggestions on the screen flickering? The screen seems to be loading or calculating many times before it is steady.

Thanks MajP, this wore me out yesterday.

Joel
 
Joel009,

I agree with MajP about a somewhat strage design (and having been helped by MajP manytimes myself, I would tell you to heed his advice).

It seems to me that the flickering has a great chance of beeing the result of cross-refreshing your forms, like a circular reference on an Excel formula. Follow the progress of the code step by step, specially because you have subforms, this might shed some light on your problem.

hth

Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
I cannot speak for 2010, but there has been notorious screen flickering with other versions. 2007 was horrible until they put out SP2. I think 2000 would go into a death spiral with conditional formatting on a calculated control. The way you have it set up is the normal fix, because you have your calculation in the format condition and not the control. However, you can try to reverse it.

in the subforms put a textbox, and you can hide it. Or you can span the whole row and "send it to back" behind your other controls, to serve as your hilite. Make its control source
= ([txtPartNumber] = nz(Forms!frmBaseRouteAssignment!txtCurPartNumber))

That shoud return a true or false for each record. True if it is the selected part. If that control is called "txtBoxSelected" then the condition becomes
expression is
txtBoxSelected = True
or if you span the row with the text box
field value is
True

In prior versions this was the opposite of what you want to do. If you span the row with a single textbox, you want to ensure the color of the forecolor is the same as the backcolor so you do not see "True or False".
 
Here is some history with different versions:
But there is no theoretical reason what you are doing should not work, it just is a bug.




Based on the versions the work arounds are different and inconsistent.

If what I suggested does not work I would try this to debug. Put conditional formatting on 1 subform. If no flickering try 2...

If you can do just one subform I would do a trick. I would through code set conditional format only on the subform of the current tab. As you change tabs remove all conditional formatting, and reapply to the active tab.
See example of coding format conditions:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top