Kamis, 07 Februari 2013

[MS_AccessPros] Multi columns report - remove a line when the report reaches the EOF

 

I have a multi columns report sample that looks like below.

Name: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
City: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
State: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
Region: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
District: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
----------------------------------------------------------
Name: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
City: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
State: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
Region: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
District: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
----------------------------------------------------------
******End of Report ******

And have been trying to remove the last 'dashed line' when the report or record set reaches the end of file. Below is the code which I tried. It's not working. What's right way to do it?

Thanks
Phucon

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer

If Me.Left < 1.5 * 1440 Then
Me.NextRecord = False
For i = 1 To 5
Me("txt" & i).Visible = False
Me("lbl" & i).Visible = True
Next i
Else
For i = 1 To 5
Me("txt" & i).Visible = True
Me("lbl" & i).Visible = False
Next i
End If

Set db = CurrentDb
Set rs = db.OpenRecordset(strRS)

With rs
If .EOF Then
Me.lineNextRow.Visible = False
End If
End With

End Sub

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar