How many lines are in a continuous form

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.
 
E

Eric D. Braden

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.
 
H

Hans Up

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top