How many lines are in a continuous form

  • Thread starter Thread starter Eric D. Braden
  • Start date Start date
E

Eric D. Braden

Is there a programatic way to determine how many lines or records are
visible in a continuous form? Specifically, I want to be able to
include the blank record that appears when you begin entering data
into a new record that you have not yet saved.

For context:
I have a continuous subform on my main form. I have code that counts
the record in the table linked to the subform. The code uses that
count to resize the subform control on the main form. As such, it
doesn't show that extra line until the record is saved. So, a user
mouse clicking through the combo box on the subform is required to
click outside of the box or use some other method to force a save in
order for the next entry line to appear.

This is my current code:

Me.Parent.sub_CourseMod.Height = (DCount("CourseID", "t_CourseMod",
"CourseID = Forms.f_CourseEdit.CourseID") + 1) * 315

Thanks for any advice,

Eric B.
 
Looks like I posted just a bit too soon. Shortly after posting I
realized that the OnDirty event is (I think) what I'm looking for.

The only problem is putting some similar code into OnDirty makes odd
things happen. I'm unable to actually select anything after the first
time, and right clicking crashes Access.
 
Eric said:
Looks like I posted just a bit too soon. Shortly after posting I
realized that the OnDirty event is (I think) what I'm looking for.

OnDirty will fire when you enter data in the new record. However, it
will also fire when you change a value in an existing record. Is that
what you want?

I'm not sure what you want, but wonder if Me.NewRecord and/or
Me.RecordsetClone.RecordCount might be helpful.
 
Back
Top