highlighting record in continuous form not working

  • Thread starter Thread starter Francis
  • Start date Start date
F

Francis

Hello i tried the Stephen lebanons solutions to highlight records, in
continuos or dataview forms.
Check in: http://www.lebans.com/conditionalformatting.htm

Anyway i copied/paste he modules and class modules, i updated the
form's load, current and unload events. I created a txtbox unbound with
the name: txtBackground. And i corrected the End If that wasnt passing
by reference in the class module as it is advised.

Still ist'n not working. Can anyone tell me where is the bug.
Thanks
 
What is it exactly you are trying to accomplish?
Which CF solution in the MDB you downloaded are you trying to implement?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I'm trying Leban's version for now,

well i'm trying to make a row in my continuous form, to highlight, as
soon as a control in it is selected (only the selected row).

I just downloaded all the modules and class modules, and im trying to
implement this in the Form:
CF solution for continous forms that works also in datasheet forms.

I copied all the 5 objects you have in A2KConditionalFormattingVer27
regarding the class modules and modules. And i done all the steps.

my form is a simple one (doesnt have subforms)

It has 4 textfields and 2 buttons, thats all, it's continous. I added
also the txtBackground textbox, and corrected the bug in the End If
sentence of the classmodule that wasnt passing by reference.

anything i forgot or i«m skipping?
thanks

Stephen Lebans escreveu:
 
Oh and im Trying the CF solution that appear in the Form:
CustomerInContinuousView

Francis
 
What End If Bug are you referring to?

I just had a quick peek. There's not much to implementing this specific
functionality. Here is the code behind the sample form.

Option Compare Database

' Declare an instance of our class
Private cf As ClsConditionalFormatting


Private Sub Form_Current()
' Call our redraw function.
' We have to do this here because of a bug using
' Withevents to sink a Form's events from a Class module.
cf.Redraw
End Sub


Private Sub Form_Load()
' startup our class
Set cf = New ClsConditionalFormatting
' You must set a reference to a TextBox control
' that you have placed anywhere in the Detail section.
' Don't worry about the control's size or placement.
' The class will position, size and set it's properties as required.
cf.BGTextBox = Me.txtBackGround

' Set the desired Highlight Color
cf.HighlightColor = CLng(vbRed)
End Sub

Private Sub Form_Unload(Cancel As Integer)
' Release the reference to our class.
Set cf = Nothing
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Hi,

Is it too late to join in? Stephen I will study your class object solution
with interest. However highlighting the current row is something I often do
using in-line code. There are some prerequisites.

Add an unlabled, unbound, disabled text box to the controls on the row; make
this text box flat and unbordered; set the back colour to the colour of the
details section; size the text box to the exact area of the row; move the
text box behind all other controls; name the text box something appropriate
such as txtHighlight.

Make all the other controls in the row transparent.

Include something similar to the following in the form's event coding:

Private Sub Form_Current()
Highlight_Row
End Sub

Sub Highlight_Row()
'Highlighting is achieved via a background text box.
'Set backcolour = white if this is the current record.
With Me.Controls("txtHighlight")
.FormatConditions.Delete
.FormatConditions.Add acExpression, , "[ContactId] = " &
Me![ContactId]
.FormatConditions(0).BackColor = vbWhite
.FormatConditions(0).Enabled = False
End With
End Sub

Regards,

Rod Plastow
 
Hi Stephen,

Just glanced through your solution. OK, it's nothing to do with class
modules - where did I get that idea? In fact it's a much more generic
solution to the code I use; my solution relies on each row having a unique
value whereas yours works on the relative row number.

Regards,

Rod
 
Hello

Stephen Lebans escreveu:
What End If Bug are you referring to?

Im referring to:

Author: Van T. Dinh regarding Class Module
"clsConditionalFormattingDataSheetView"
If mShowHighlightingAlternate = False Then
Set objFrc = ctl.FormatConditions.Add(acExpression, _
, "fCurrentRow([txtcustomerid])")

Else
Set objFrc = ctl.FormatConditions.Add(acExpression, _
, "fAlternateRow([txtcustomerid])")
End If
....
I have changed the above statements to the following:
....
If mShowHighlightingAlternate = False Then
Set objFrc = ctl.FormatConditions.ADD(acExpression, _
, "fCurrentRow([" & mKeyControl.Name & "])")

Else
Set objFrc = ctl.FormatConditions.ADD(acExpression, _
, "fAlternateRow([" & mKeyControl.Name & "])")
End If
....
so that it works in general which seems to work fine in the mdb I am
working on.



Ok this problem applies to the Class Module "clsConditionalFormatting"
as well (if you have available the solution for this you can post it
thanks). And we are using this class Module in Form's Name
"CustomerInContinuousView".


Regarding the form's code, i was thinking in implementing the
functionalities we see exactly in your sample: CustomerInContinuousView
(with all those buttons working to toggle on and off the CURRENT ROW
HIGHLI and ALTERNATE ROW HIGHL.

Ône Important thing is that im using: OPTION EXPLICIT in all coding.

Error im geting is 'Run time error 2100' The control or Subform control
is too large for location. And it points to the CF.BGTextBox =
Me.txtBackGround.

Thanks for any answers, this looks far more complicated then it is,
anymore comments apreciated on this lets sort this bugging :)
 
Well as noone answers or knows the answer i assume this envolves a
little more bug sorting then expected, so i have copied paste all the
modules and class modules, and the customerInContinuousView Form and
changes only the control surces to meet my data structure (didnt change
any control name so it runs ok) and guess what???

It still isntworking, when i open the customerInContinuousView form it
simply doesnt do anything even when you click the buttons.

If noone replies to this i think that is incomplete and ill look for
contributions that are working.

Thanks advance
 
Francis, the original CustomerInContinuousView form works properly in the
original MDB you downloaded from my site. In trying to implement the sample
in your own MDB, you have made changes to the underlying Class module, and
you now publicly state that my solution is "incomplete" and "not working".

I would suggest that you stop using my code and find another solution.
Good luck with your project.

--

Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
fellow all i did was:
*copy /paste yer modules and Class modules, copy/paste the form
CustomerInContinuousView, into my MDB
*As it won't find the record source customernoname i had to put the
record sources i had available.
*after that nothing happens i dont see why it is not working.
*i asked here why wasn't it working
*i did said it was incomplete and not working because you have to
change the Class Module in order to make it work with your own database
(since you didnt implement passing by reference as Author: Van T. Dinh
pointed out in your own site).

And if you deal with people not agreeing with you like that i think you
are not in the better place, this not for you. Regarding you atitude of
me not using your code i laughing because i do it as i, not you, want
if i find is working, it is not working unless someone or others help
on it so, come on, guyes. Considering you are an individual acting with
goodwill let's leave this issue inofensive and silly and go to further
trying resolving cf's issues.

If anyone has an idea of why my database isnt working, or have
experienced sames results please state them anyway thanks.
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK (btw im kidding) I've figure another way to resolve those
forms and if need further informations i will post thanks.

Stephen Lebans escreveu:
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK@u (btw im kidding) Seriously Now I've figure another way
to resolve those forms and If need further informations i will post
thanks.Francisfellows

Stephen Lebans escreveu:
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK@u (btw im kidding) Seriously Now I've figure another way
to resolve those forms and If need further informations i will post
thanks.Francisfellows

Stephen Lebans escreveu:
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK@u (btw im kidding) Seriously Now I've figure another way
to resolve those forms and If need further informations i will post
thanks.Francisfellows

Stephen Lebans escreveu:
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK@u (btw im kidding) Seriously Now I've figure another way
to resolve those forms and If need further informations i will post
thanks.Francisfellows

Stephen Lebans escreveu:
 
Hi Stephen ... you are a bit weird still your funny
are you leaving?? well goodbye
thanks PLONK@u (btw im kidding) Seriously Now I've figure another way
to resolve those forms and If need further informations i will post
thanks.Francisfellows
 
Back
Top