I have a form that I select multiple files to plot data from. The form can have as many as five files selected to plot data from; each corresponds to a control txtFile1, txtFile2, etc. The cmdPLOT button on the form calls a report that contains the graph and is using a subroutine called DrawGraph(). I am trying to create the legend on the graph by referencing the txtFile name from the controls on the form, which are the full paths for the files that I wish to plot.
For i = 1 To NoFiles
Me.DrawWidth = 8
Me.DrawStyle = 0
'Legend Lines (left, top, right, bottom)
Me.Line (lngBorderLeft + intXAxisCategoryWidth + _ 4050, lngBorderTop + i * 300)-(lngBorderLeft + intXAxisCategoryWidth * 2 + 4000, lngBorderTop + i * 300), _
Choose(i Mod 5 + 1, vbBlack, vbMagenta, _ vbBlue, vbRed, vbGreen)
'Legend name placement
Me.CurrentY = Me.CurrentY - 100
Me.CurrentX = Me.CurrentX + 50
Me.FontSize = 12
Me.FontBold = True
'Print Legend names
strFileN = [Forms]![frmselectfiles]![txtFile & " i " &]
adhSplitPathA strFileN, strDrive, strPath, strFileName, strExt
Me.Print strFileName
Next i
I keep getting the same error, that it cannot find [Forms]![frmselectfiles][txtFile & "i" &]. If I hard code in [Forms]![frmselectfiles][txtFile1], it works fine for the one file, but it will not let me loop through all the controls to print all the file names.
Thanks for your help in advance.
BusMgr
For i = 1 To NoFiles
Me.DrawWidth = 8
Me.DrawStyle = 0
'Legend Lines (left, top, right, bottom)
Me.Line (lngBorderLeft + intXAxisCategoryWidth + _ 4050, lngBorderTop + i * 300)-(lngBorderLeft + intXAxisCategoryWidth * 2 + 4000, lngBorderTop + i * 300), _
Choose(i Mod 5 + 1, vbBlack, vbMagenta, _ vbBlue, vbRed, vbGreen)
'Legend name placement
Me.CurrentY = Me.CurrentY - 100
Me.CurrentX = Me.CurrentX + 50
Me.FontSize = 12
Me.FontBold = True
'Print Legend names
strFileN = [Forms]![frmselectfiles]![txtFile & " i " &]
adhSplitPathA strFileN, strDrive, strPath, strFileName, strExt
Me.Print strFileName
Next i
I keep getting the same error, that it cannot find [Forms]![frmselectfiles][txtFile & "i" &]. If I hard code in [Forms]![frmselectfiles][txtFile1], it works fine for the one file, but it will not let me loop through all the controls to print all the file names.
Thanks for your help in advance.
BusMgr