M
mark kubicki
I have a report where several of the fields, because of multiple contingency
fields and "in-fill" text", content is best (?) determined by
putting them into code (I had tried SQL, but that was beyond cumbersome)
the content would be based on the value of other fields in the same or other
tables
the code I have entered for the report detail field txtDescription might be
something like this
----------------------------------------------------------------------------------
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim dbs As Database
Dim rst As DAO.Recordset
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim strDescription As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("FixtureTypesNoProject", dbOpenSnapshot)
Set rst1 = dbs.OpenRecordset("projectninfo", dbOpenSnapshot)
Set rst2 = dbs.OpenRecordset("tblFixtureSchedulePrintoptions",
dbOpenSnapshot)
strDescription = ""
strDescription = strDescription & (rst!basedescription + " ")
If rst2!ShortDescription <> "false" Then
If rst!PrintAddDescription Then
strDescription = strDescription & (rst!AdditionalDes + " ")
End If
End If
If rst2!LocationPrint <> "false" Then
strDescription = strDescription & ("Location: " +
rst!Location + " ")
End If
.... 'lots more "if" criteria and inserted text...
Me.txtDescription = strDescription
----------------------------------------------------------------------------------
what it results in is the information for record 1, not being shown at all
in record 1 of the report, but showing in record 2, and every subsequent
record in the report
thanks in advance,
mark
fields and "in-fill" text", content is best (?) determined by
putting them into code (I had tried SQL, but that was beyond cumbersome)
the content would be based on the value of other fields in the same or other
tables
the code I have entered for the report detail field txtDescription might be
something like this
----------------------------------------------------------------------------------
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim dbs As Database
Dim rst As DAO.Recordset
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim strDescription As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("FixtureTypesNoProject", dbOpenSnapshot)
Set rst1 = dbs.OpenRecordset("projectninfo", dbOpenSnapshot)
Set rst2 = dbs.OpenRecordset("tblFixtureSchedulePrintoptions",
dbOpenSnapshot)
strDescription = ""
strDescription = strDescription & (rst!basedescription + " ")
If rst2!ShortDescription <> "false" Then
If rst!PrintAddDescription Then
strDescription = strDescription & (rst!AdditionalDes + " ")
End If
End If
If rst2!LocationPrint <> "false" Then
strDescription = strDescription & ("Location: " +
rst!Location + " ")
End If
.... 'lots more "if" criteria and inserted text...
Me.txtDescription = strDescription
----------------------------------------------------------------------------------
what it results in is the information for record 1, not being shown at all
in record 1 of the report, but showing in record 2, and every subsequent
record in the report
thanks in advance,
mark