Subroutine

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What does this term mean? I'm trying to add color and the instructions say
"bcg_CreateRectangles "<MyFormName>", False - it says to run this
"subroutine", run it where? I'm confused!!!! (o:

Thanks!
 
I'm trying to add color and the instructions say
"bcg_CreateRectangles "<MyFormName>", False - it says to run this
"subroutine", run it where?

Whoa! This is equivalent to someone handing you a pill and saying, "Swallow
this." Blindly copying and running someone else's code is asking for a lot
of trouble. How are you going to fix the problems it may cause? How are you
going to know what it's going to do to your database application and to your
computer? You don't.

The code you want to run uses significant resources every time the form
(<MyFormName>) opens. The code has a memory leak and running it a few times
to create the rectangles for even a moderate sized form will result in "out
of memory" errors. Future changes to the form will be a hassle because the
significant number of rectangles this code creates are in the way when you
want to move the existing controls around on the form. You'll end up
deleting the rectangles, making your changes, then recreating the rectangles
again. Doing this several times will result in another hassle. The 754
limit for controls, fields, and form sections per form will be reached,
because this number never decreases, even when controls are deleted. And
using this code in Access 2003 will result in odd visual effects.

Instead of blindly running this code you found, I'd recommend that you take
a few courses in Microsoft Access and programming so that you know what's
what -- and what's not good for your database application. Then you can sit
down and fix the code yourself to avoid many of the problems I mentioned.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
It looks like bcg_CreateRectangles is a procedure.
bcg_CreateRectangles requires you to pass to variables to it.
One is a string and the other is true or false
Anything between " " is the string text you are passing to the procedure.
Programmers sometimes use things like <MyFormName> it point out to you that
the name of the form goes here.

To run this you need to put all the bcg_CreateRectangles code in a form or
module.
Then you need to have something call the bcg_CreateRectangles procedure like
a button, macro, another sub procedure, etc.
The line of code to run the bcg_CreateRectangles procedure would look like
this:
bcg_CreateRectangles "EmployeeForm", False

Hope this helps!
Good Luck.
 
I assume that you are using a download of a sample from Peter's Software.

Open the module and do the following:

in sub procedure sub examples() read the comments

change "myform" to the name of your form

then on "myform" on the open event add the following code

Private Sub Form_Open(Cancel As Integer)
bcg_SetColors Me, colour1,colour2
End Sub

colour1 is the starting colour, colour2 is the finishing colour

this grades or "colours" your form display from colour1 through to colour
try the following as an example.

Private Sub Form_Open(Cancel As Integer)
bcg_SetColors Me, 15322008, 16711680
End Sub

Allan Murphy
Email: (e-mail address removed)
 
Back
Top