Lebans Continuous Forms Sample Problem

J

JohnR

I need to change the background of each record on a continuous form based on
the value of one of the fields. From this Newgroup I was led to Stephen
Lebans sample database. I was able to adopt it to my needs and it works
great. (Thank you Stephen) However when I scroll down the form, the
formatting doesn't change. Each record keeps the color of the record that
originally occupied that space on the form. Does anyone know how to capture
the scroll event to rerun the code as the record changes?

Thank You

John
 
J

JohnR

SubClassFormatByCriteriaVer45.mdb

It changes the initial forms perfectly, but when I scroll down a page or use
PageDown the data changes but the forms keep the original colors.
 
J

JohnR

2003 :-(

Too bad, because it looked great. The client insists on 6 different colors,
so I can't use the built in conditional formatting. I'll think of
something.

Thank you for your assistance and all the great content on your web site.

John
 
S

Stephen Lebans

Well I never bother porting it to A2K or higher simply because
Conditional Formatting is now directly supported. If you are willing to
test it out then only 2 lines of code need to be changed.
Addrof needs to be modifed to call the now supported native AddressOf
method instead.

Let me know.

--

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

JohnR

I could only find one line.

It goes into a loop and freezes the form
CTRL Break gets it to stop on

Public Function WindowProcSB(ByVal hWnd As Long, ByVal message As Long,
ByVal wParam As Long, ByVal lParam As Long) As Long
 
S

Stephen Lebans

Now I remember why I did not port this sample to A2K. It's the old
Subclassing/VB IDE bug. If you have had or currently opened the VB IDE
window, then Access WIndow MEssage queque will get overloaded. If you
open the Form without having had the VB IDE open at any point during
this session then you will not encounter this bug.

There also seems to be a change from A97 in the sequence of form events.
Comment out all of the code in the resize event.

Tomorrow, I'll have a look at placing the sublassing code within an
external DLL as this is the only solution to the Subclassing bug.

It brings joy to my heart to see all of those ugly colors again on an
Access Form!<grin>
--

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

JohnR

I really appreciate your efforts.

If I distribute this as an MDE would that prevent the problem?
 

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