D
Dsperry101 via AccessMonster.com
Hey everyone ,
I have a fittings database to track fittings in a shelving unit. I am
trying make a report to draw a chart of the location of all the fittings
where some of the drawers can have up to 8 fitting. I am placing text boxes
based on calculated positions base on quantitys of drawer slots and of
locations. When I have placed the text boxes I want to put the name of each
fitting in the text box.
When I try to change the textbox it says I have to have focus but when I
try to set focus it says property or method not supported. How can I change
the text in each text box without setting focus to the control ??
Thanks ahead of
time
diagheight = 1400
diagwidth = 1225 ' twips
drawersize = 150
Set db = CurrentDb()
fittings = DLookup("ftgcnt", "qrycount") ' total count of fittings names
ftgs = Val(fittings)
Set rst = db.OpenRecordset("tblFtgs", dbOpenTable)
rst.MoveFirst
' I have a report the has about 200 text boxes with visible = false
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)
' Debug.Print "xpos " & xpos & " ypos " & ypos
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).SetFocus = True
'.Report_rptTest.Controls(index) = posstr
Report_rptTest.Controls(index).Visible = True
Report_rptTest.Controls(index).BackColor = 25000
rst.MoveNext
' Debug.Print index & " " & xpos & " " & ypos
Next index
db.Close
I have a fittings database to track fittings in a shelving unit. I am
trying make a report to draw a chart of the location of all the fittings
where some of the drawers can have up to 8 fitting. I am placing text boxes
based on calculated positions base on quantitys of drawer slots and of
locations. When I have placed the text boxes I want to put the name of each
fitting in the text box.
When I try to change the textbox it says I have to have focus but when I
try to set focus it says property or method not supported. How can I change
the text in each text box without setting focus to the control ??
Thanks ahead of
time
diagheight = 1400
diagwidth = 1225 ' twips
drawersize = 150
Set db = CurrentDb()
fittings = DLookup("ftgcnt", "qrycount") ' total count of fittings names
ftgs = Val(fittings)
Set rst = db.OpenRecordset("tblFtgs", dbOpenTable)
rst.MoveFirst
' I have a report the has about 200 text boxes with visible = false
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)
' Debug.Print "xpos " & xpos & " ypos " & ypos
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).SetFocus = True
'.Report_rptTest.Controls(index) = posstr
Report_rptTest.Controls(index).Visible = True
Report_rptTest.Controls(index).BackColor = 25000
rst.MoveNext
' Debug.Print index & " " & xpos & " " & ypos
Next index
db.Close