Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make lines visible every fifth record of a subform 1

Status
Not open for further replies.

Billbob666

Programmer
Dec 26, 2007
2
US
My first forum post ever.
I have a continuous form I am using as a subform in Microsoft Access 2003. I would like for a line to be visible every fifth record in the subform's detail section. How can I do this?
Thanks,
Billbob666
 
A continuous form is like many copies of a form shown for each record. Thus, you get the same objects on each line or showing of the continuous form.

I say that to say this, not an easy thing to do. I don't think you can make an object visible but you can maybe do some smoke and mirrors.

For instance, you can set the back color of a text box based on conditions of other text boxes or such. So you could have a text box the same color as the detail background, no borders and make it short and wide. This would look like a line. Then if a condition is met, then it would change the back color to black making it seemingly appear. The condition would be somehow the counting of the fifth record.

That's my best stab. Anyone else?


ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Exactly like Lonnie said.
1. Make a long thin textbox. Set the border transparent and make the background color equal the forms color
2. In my example I have a unique ID called personnelID. You will need a unique field to identify the record.
3. Build a function that returns true or false if your record is a multiple of your specified interval

public function showLine(intID as integer, intLineCount as integer) as boolean
dim rs as dao.recordset
set rs = me.recordsetclone
rs.findfirst ("pesonnelID = " & intID)
if (rs.absolutePosition + 1)/intLineCount = (rs.absolutePosition + 1)\intLineCount then
showLine = true
end if
rs.close
set rs = nothing
end function

4.
in the calculated field the recordsource is
=showLine([personnelID],5)
6. Using conditional formatting change the background color of your text box if the value is true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top