Drawing Lines with a looping statement

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

I have a form that I want to display a chart that appears similar to a month
planner...There will be 31 rows (depending on the month) with the dates
showing on the left column. I want to have the weekend days in bold text
and the outlines of the rows in 2 point. Now...I have some questions
regarding the coding. First when drawing lines with a looping statement,
what is the way to call the line and is the name of the line automatic?
 
Jeff said:
I have a form that I want to display a chart that appears similar to
a month planner...There will be 31 rows (depending on the month) with
the dates showing on the left column. I want to have the weekend
days in bold text and the outlines of the rows in 2 point. Now...I
have some questions regarding the coding. First when drawing lines
with a looping statement, what is the way to call the line and is the
name of the line automatic?

I'm not sure I have a clear picture of what you have in mind, but I'd
suggest that you not attempt to create controls at run time. Instead,
create all the controls you might need at design time, naming them as
you like and giving them some default size and position values, but
making them invisible. Then at run time, use code to appropriately
position and size those controls you actually need, and make them
visible.
 
Good idea on adding the controls first...although the coding that
repositions the lines, I am trying to add within a looping statement. The
name of my lines are HLine1, HLine2, HLine3...etc.

I thought that I could create a string called "HLine" and add the number to
the end of this string creating another string called "LineVariable" and
then using this string in the code that repositions the line.

In my code:
LineVariable = "HLine" & 1
LineVariable.top = .25 / This should be the same as HLine1.top = .25
Right???

I get an error "Invalid Qualifier" .

If this is not the right way to add multiple lines in a looping statement
please let me know the right way.
 
Try Me.Controls(LineVariable).Top = .25

However, I think you'll find .25 isn't an appropriate value for Top. The Top
property is stored in Twips, where there are 1440 twips to an inch. If
you're trying to set it to a quarter inch, try using 360 (1440/4)
 
Doug,
Thanks for the reply...Are the names of the lines incorrect? If I try
Me.HLine(counter).top, I get the error: "Method or data member not found".
I think I am missing something simple. Do I need to declare HLine a varient
or something?
 
Got It working....Thanks all

Jeff said:
Doug,
Thanks for the reply...Are the names of the lines incorrect? If I try
Me.HLine(counter).top, I get the error: "Method or data member not found".
I think I am missing something simple. Do I need to declare HLine a varient
or something?
 
Back
Top