D
Dsperry101 via AccessMonster.com
Hey everyone ,
I have a report I'm trying to build based on a table fittings , the
list can vary so I am trying to build the report form the table. I am using a
number of textboxes , positioning and sizing the based on the quanity of
fields in the table.
The problem is in writing the text to the boxes. When I try to modify
the text of the control it says I can't do unless it has focus and when I try
to set focus it says method not supported ( I guess in report mode). How can
I change the text of the text box.
Set rst = db.OpenRecordset("tblFtgs", dbOpenTable)
rst.MoveFirst
For index = 2 To (fittings + 1)
'
' a b c d e
'1 drawer slots a b c d e f g h 8" wide
'2 10" high
'3
'4
'5
'6
'7
'8
'
posstr = rst![fldLocation]
col = Val(Asc(Left(posstr, 1))) - 64
row = Val(Mid(posstr, 2, 1))
pos = Val(Asc(Right(posstr, 1))) - 64
If col = 8 Then col = 7
Debug.Print "row = " & Str(row) & "col = " & Str(col) & "pos = " & Str
(pos)
xpos = 200 + (diagwidth * (col - 1))
ypos = 10 + (diagheight * (row - 1)) + (pos * drawersize)
Report_rptTest.Controls(index).Left = xpos
Report_rptTest.Controls(index).Top = ypos
Report_rptTest.Controls(index).width = 500
Report_rptTest.Controls(index).height = 125
Report_rptTest.Controls(index).Visible = True
Report_rptTest.Controls(index).BackColor = 25000
rst.MoveNext
Next index
db.Close
End Sub
The form has about 200 text boxes and I'm just positioning and using as
many as I need to build the report.
I want to :
Report_rptTest.Controls(index).text = "fitting description"
Any ideas how to do this ??
Thanks ahead of time
Dan S
I have a report I'm trying to build based on a table fittings , the
list can vary so I am trying to build the report form the table. I am using a
number of textboxes , positioning and sizing the based on the quanity of
fields in the table.
The problem is in writing the text to the boxes. When I try to modify
the text of the control it says I can't do unless it has focus and when I try
to set focus it says method not supported ( I guess in report mode). How can
I change the text of the text box.
Set rst = db.OpenRecordset("tblFtgs", dbOpenTable)
rst.MoveFirst
For index = 2 To (fittings + 1)
'
' a b c d e
'1 drawer slots a b c d e f g h 8" wide
'2 10" high
'3
'4
'5
'6
'7
'8
'
posstr = rst![fldLocation]
col = Val(Asc(Left(posstr, 1))) - 64
row = Val(Mid(posstr, 2, 1))
pos = Val(Asc(Right(posstr, 1))) - 64
If col = 8 Then col = 7
Debug.Print "row = " & Str(row) & "col = " & Str(col) & "pos = " & Str
(pos)
xpos = 200 + (diagwidth * (col - 1))
ypos = 10 + (diagheight * (row - 1)) + (pos * drawersize)
Report_rptTest.Controls(index).Left = xpos
Report_rptTest.Controls(index).Top = ypos
Report_rptTest.Controls(index).width = 500
Report_rptTest.Controls(index).height = 125
Report_rptTest.Controls(index).Visible = True
Report_rptTest.Controls(index).BackColor = 25000
rst.MoveNext
Next index
db.Close
End Sub
The form has about 200 text boxes and I'm just positioning and using as
many as I need to build the report.
I want to :
Report_rptTest.Controls(index).text = "fitting description"
Any ideas how to do this ??
Thanks ahead of time
Dan S