jennypretty
Registered User.
- Local time
- Yesterday, 16:46
- Joined
- Jun 4, 2007
- Messages
- 16
Hello,
I am trying to create a report to set all Labels on one column (left) and data to 2nd column, but it does not work.
My code below will combine a few table columns on one column and delete any empty rows.
Can any one help please?
Thanks.
Dim nBaseXAxis As String 'var to keep left most position of the cursor at starting
Dim nBaseFontSize As Integer
Dim nBaseFontColor As Variant
Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'//-- Report format
nBaseXAxis = 0
nBaseFontSize = 12
nBaseFontColor = vbBlack
printLabel "Last Name: " & Trim(Me.LastName.Value), nBaseXAxis, 12, vbBlack
'Me.Print Me.LastName.Value & vbCrLf & vbCrLf
Me.Print ""
'//-- PRINT Q5 -------------------------------------------------
strRowVal = ""
If Len(Trim(Nz(Me.Q51.Value, ""))) > 0 Then
strRowVal = strRowVal & Q51 & "*"
End If
If Len(Trim(Nz(Me.Q52.Value, ""))) > 0 Then
strRowVal = strRowVal & Q52 & "*"
End If
If Len(Trim(Nz(Me.Q53.Value, ""))) > 0 Then
strRowVal = strRowVal & Q53 & "*"
End If
If Len(Trim(Nz(Me.Q54.Value, ""))) > 0 Then
strRowVal = strRowVal & Q54 & "*"
End If
If Len(Trim(Nz(Me.Q55.Value, ""))) > 0 Then
strRowVal = strRowVal & Q55 & "*"
End If
If (Len(Trim(strRowVal)) > 0) Then
strRowValArr = Split(strRowVal, "*")
printLabel "Q5: " & Trim(strRowValArr(0)), nBaseXAxis, 12, vbBlack
x = 420
For i = 1 To UBound(strRowValArr)
printLabel strRowValArr(i), x, 12, vbBlack
Next
End If
End Sub
Public Function printLabel(strText, nHAxis, nTextFontSize, nTextFontColor)
Me.CurrentX = nHAxis
Me.FontBold = True
Me.FontSize = nTextFontSize
Me.ForeColor = nTextFontColor
Me.Print strText
'Me.CurrentX = nHAxis
Me.FontBold = False
Me.FontSize = nBaseFontSize
Me.ForeColor = nBaseFontColor
End Function
Private Sub Report_Open(Cancel As Integer)
End Sub
I am trying to create a report to set all Labels on one column (left) and data to 2nd column, but it does not work.
My code below will combine a few table columns on one column and delete any empty rows.
Can any one help please?
Thanks.
Dim nBaseXAxis As String 'var to keep left most position of the cursor at starting
Dim nBaseFontSize As Integer
Dim nBaseFontColor As Variant
Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'//-- Report format
nBaseXAxis = 0
nBaseFontSize = 12
nBaseFontColor = vbBlack
printLabel "Last Name: " & Trim(Me.LastName.Value), nBaseXAxis, 12, vbBlack
'Me.Print Me.LastName.Value & vbCrLf & vbCrLf
Me.Print ""
'//-- PRINT Q5 -------------------------------------------------
strRowVal = ""
If Len(Trim(Nz(Me.Q51.Value, ""))) > 0 Then
strRowVal = strRowVal & Q51 & "*"
End If
If Len(Trim(Nz(Me.Q52.Value, ""))) > 0 Then
strRowVal = strRowVal & Q52 & "*"
End If
If Len(Trim(Nz(Me.Q53.Value, ""))) > 0 Then
strRowVal = strRowVal & Q53 & "*"
End If
If Len(Trim(Nz(Me.Q54.Value, ""))) > 0 Then
strRowVal = strRowVal & Q54 & "*"
End If
If Len(Trim(Nz(Me.Q55.Value, ""))) > 0 Then
strRowVal = strRowVal & Q55 & "*"
End If
If (Len(Trim(strRowVal)) > 0) Then
strRowValArr = Split(strRowVal, "*")
printLabel "Q5: " & Trim(strRowValArr(0)), nBaseXAxis, 12, vbBlack
x = 420
For i = 1 To UBound(strRowValArr)
printLabel strRowValArr(i), x, 12, vbBlack
Next
End If
End Sub
Public Function printLabel(strText, nHAxis, nTextFontSize, nTextFontColor)
Me.CurrentX = nHAxis
Me.FontBold = True
Me.FontSize = nTextFontSize
Me.ForeColor = nTextFontColor
Me.Print strText
'Me.CurrentX = nHAxis
Me.FontBold = False
Me.FontSize = nBaseFontSize
Me.ForeColor = nBaseFontColor
End Function
Private Sub Report_Open(Cancel As Integer)
End Sub