Private Sub Command4_Click()
Set rs = New adodb.Recordset
rs.Open " select * from MR query", con, adOpenKeyset, adLockPessimistic
If rs.RecordCount > 0 Then
If Not rs.EOF Then
With DataReport2.Sections("section1").Controls
.Item("text1").DataField = rs.Fields("dept_name").Name
End With
Set DataReport2.DataSource = rs
DataReport2.Show
End If
End If
End Sub
try to erase this
DataReport2.Orientation = rptOrientLandscape
and change this adOpenDynamic, adLockOptimistic
to this adOpenKeyset, adLockPessimistic
regards
Ryan Riel