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
Me.PSet (300,0)  'Move over a bit then draw some more boxes, but this time 8 wide
W = 8
End Sub

Private sub DrawBoxes ()
Me.Line  (0, 0) - Step (BoxHeight , W) ,0 ,B
end sub
Who is Participating?
Barry CunneyConnect With a Mentor Commented:
Private sub DrawBoxes (Width% = 5)
Me.Line  (0, 0) - Step (BoxHeight , Width%) ,0 ,B
end sub

DrawBoxes 8
DatabaseDekAuthor Commented:
Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.