R
robc
I have written a report where different items are printed and the number of
lines printed varies based on LineType. I obviously have something wrong
here however... most of it appears to be working, however, when a LineType
"7" item is printed the GrossWeight column is Visible on the report.
Anyone know why ?
Also, does Access keep track internally when you print 3 rows for 1 line of
data (so it knows when to kick to the next page) ?
thanks !
The following is executed using the OnFormat Event...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.LineType = "1" Then
' This does not print at all
Me.NComment.Visible = False
Me.NComment.Top = 0
Me.MShipQty.Visible = False
Me.MShipQty.Top = 0
' Want this to be 3 rows high
Me.Section(acDetail).Height = 720
' This goes on Line 1
Me.MStockCode.Visible = True
Me.MStockCode.Top = 0
Me.MStockDes.Visible = True
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = True
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = True
Me.MCusSupStkCode.Top = 0
Me.MOrderUom.Visible = True
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = True
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = True
Me.NetWeight.Top = 0
Me.MPrice.Visible = True
Me.MPrice.Top = 0
Me.PlaceHolder.Visible = True
' This is on Line 2 within the section
Me.txtPackShipped.Top = 240
Me.MCusSupStkCode.Top = 240
' This is on Line 3 within the section
Me.PlaceHolder.Top = 480
ElseIf Me.LineType = "7" Then
' This does not print at all
Me.NComment.Visible = False
Me.NComment.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.MStockCode.Visible = True
Me.MStockCode.Top = 0
Me.MStockDes.Visible = True
Me.MStockDes.Top = 0
Me.MShipQty.Visible = True
Me.MShipQty.Top = 0
Me.MOrderUom.Visible = True
Me.MOrderUom.Top = 0
Me.NetWeight.Visible = True
Me.NetWeight.Top = 0
ElseIf Me.LineType = "6" Then
' This does not print at all
Me.MStockCode.Visible = False
Me.MStockCode.Top = 0
Me.MStockDes.Visible = False
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = False
Me.NetWeight.Top = 0
Me.MShipQty.Visible = False
Me.MShipQty.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
' Me.PackUOMShipped.Visible = False
' Me.PackDesc.Visible = False
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.NComment.Top = 0
Me.NComment.Visible = True
ElseIf Me.LineType = "5" Then
' This does not print at all
Me.MStockCode.Visible = False
Me.MStockCode.Top = 0
Me.MStockDes.Visible = False
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = False
Me.NetWeight.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
' Me.PackUOMShipped.Visible = False
' Me.PackDesc.Visible = False
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.NComment.Visible = True
Me.NComment.Top = 0
Me.MShipQty.Visible = True
Me.MShipQty.Top = 0
End If
End Sub
lines printed varies based on LineType. I obviously have something wrong
here however... most of it appears to be working, however, when a LineType
"7" item is printed the GrossWeight column is Visible on the report.
Anyone know why ?
Also, does Access keep track internally when you print 3 rows for 1 line of
data (so it knows when to kick to the next page) ?
thanks !
The following is executed using the OnFormat Event...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.LineType = "1" Then
' This does not print at all
Me.NComment.Visible = False
Me.NComment.Top = 0
Me.MShipQty.Visible = False
Me.MShipQty.Top = 0
' Want this to be 3 rows high
Me.Section(acDetail).Height = 720
' This goes on Line 1
Me.MStockCode.Visible = True
Me.MStockCode.Top = 0
Me.MStockDes.Visible = True
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = True
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = True
Me.MCusSupStkCode.Top = 0
Me.MOrderUom.Visible = True
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = True
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = True
Me.NetWeight.Top = 0
Me.MPrice.Visible = True
Me.MPrice.Top = 0
Me.PlaceHolder.Visible = True
' This is on Line 2 within the section
Me.txtPackShipped.Top = 240
Me.MCusSupStkCode.Top = 240
' This is on Line 3 within the section
Me.PlaceHolder.Top = 480
ElseIf Me.LineType = "7" Then
' This does not print at all
Me.NComment.Visible = False
Me.NComment.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.MStockCode.Visible = True
Me.MStockCode.Top = 0
Me.MStockDes.Visible = True
Me.MStockDes.Top = 0
Me.MShipQty.Visible = True
Me.MShipQty.Top = 0
Me.MOrderUom.Visible = True
Me.MOrderUom.Top = 0
Me.NetWeight.Visible = True
Me.NetWeight.Top = 0
ElseIf Me.LineType = "6" Then
' This does not print at all
Me.MStockCode.Visible = False
Me.MStockCode.Top = 0
Me.MStockDes.Visible = False
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = False
Me.NetWeight.Top = 0
Me.MShipQty.Visible = False
Me.MShipQty.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
' Me.PackUOMShipped.Visible = False
' Me.PackDesc.Visible = False
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.NComment.Top = 0
Me.NComment.Visible = True
ElseIf Me.LineType = "5" Then
' This does not print at all
Me.MStockCode.Visible = False
Me.MStockCode.Top = 0
Me.MStockDes.Visible = False
Me.MStockDes.Top = 0
Me.txtPackShipped.Visible = False
Me.txtPackShipped.Top = 0
Me.MCusSupStkCode.Visible = False
Me.MCusSupStkCode.Top = 0
Me.PlaceHolder.Visible = False
Me.PlaceHolder.Top = 0
Me.MOrderUom.Visible = False
Me.MOrderUom.Top = 0
Me.GrossWeight.Visible = False
Me.GrossWeight.Top = 0
Me.NetWeight.Visible = False
Me.NetWeight.Top = 0
Me.MPrice.Visible = False
Me.MPrice.Top = 0
' Me.PackUOMShipped.Visible = False
' Me.PackDesc.Visible = False
' Want this to be 1 row high
Me.Section(acDetail).Height = 240
Me.NComment.Visible = True
Me.NComment.Top = 0
Me.MShipQty.Visible = True
Me.MShipQty.Top = 0
End If
End Sub