Passing a variable from one procedure into another

I have a procedure that draws boxes in a report. The width of the boxes varies but does not effect the rest of the boxes. So I want to write:

Private sub Boxes
Dim W as integer
W = 5  'Draw boxes 5 Wide
DrawBoxes
Me.PSet (300,0)  'Move over a bit then draw some more boxes, but this time 8 wide
W = 8
DrawBoxes
End Sub

Private sub DrawBoxes ()
Me.Line  (0, 0) - Step (BoxHeight , W) ,0 ,B
end sub
Derek BrownMDAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Barry CunneyCommented:
Private sub DrawBoxes (Width% = 5)
Me.Line  (0, 0) - Step (BoxHeight , Width%) ,0 ,B
end sub


DrawBoxes 8
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Derek BrownMDAuthor Commented:
Thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.