grouping with VBA

SamDeMan

Registered User.
Local time
Today, 11:04
Joined
Aug 22, 2005
Messages
182
Hi all,

I am trying to get the first control (employee Name) to appear on the report on the same line as the first detail, and then on subsequent lines it shouldn't appear. if i use an ordinary grouping then i would put in the control (employee name) within the group header. this would skip a line. i would like to write something vba but i was wondering if anybody has ready code for this.

thanks,

sam
 
You don't actually need code, if you've got what I think you've got. Set the Hide Duplicates property of the name textbox to Yes.
 
thanks paul, i just read it in getz's book. however, i am having a problem with it which i hope to resolve soon. i am using in the Detail_Format a script which alternates colored lines. so one line is yellow and the next is no color (or white). now that doesn't work correctly.

this is my code:

Private mblnGray As Boolean

Private Sub AlternateGrayTheHardway()
Dim lngColor As Long

lngColor = IIf(mblnGray, vbYellow, vbWhite)
txtName.BackColor = lngColor
txtPrgEmpNo.BackColor = lngColor
txtAccrualCode.BackColor = lngColor
txtAllowed.BackColor = lngColor
txtTakenTotal.BackColor = lngColor
txtAccrued.BackColor = lngColor
txtEacDateAccruedThru.BackColor = lngColor

' Next time, do it the opposite of the way
' you did it this time.
mblnGray = Not mblnGray
End Sub
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Call AlternateGrayTheHardway
End Sub

i appreciate your quick response.

sam
 
ok, i solved it. i created a dummy textbox that lies underneath the hidden control. now the color changes for the entire row.

thanks,

sam
 

Users who are viewing this thread

Back
Top Bottom