View Single Post
  #3  
Old March 3rd, 2010, 02:16 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Limit rows in subform based on field in main form

On Tue, 2 Mar 2010 15:50:01 -0800, cynteeuh
wrote:

In some subforms users can sort the data differently, so just making
the top N rows editable is not going to be good enough. How will we
know which rows you mean?

In general terms you can write code in the subform's Form_Current
event and set Me.AllowEdits to True or False based on if it's in the
first N rows or not.
Me.RecordsetClone.AbsolutePosition can be used to get the 0-based row
count.

-Tom.
Microsoft Access MVP


I have a main form that has a number field (this field inidcates the number
of seats available). I want the subform to only allow the user to enter data
in rows that are equal or less than than the number field in the main form.

please help with code and best place to enter.

many thanks!!!