Access Forms hiding the row in a form and showing it after the last record is entered.

We have a form that is a series of detail records that enters in
Line Number - Product Code - Product Description - Weight - Lot Number

After the user enters the following records into the Access Form by default there is always a new empty row already waiting for the user to enter in the next line of data for the next record.

We were wondering if that blank empty set of windows for that next line can be set up to only be visible to the user say...."after the Lot Number shown above has had a value entered in and or the user has hit the Tab Key or The Enter Key" Is this possible...?
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Asked:
Who is Participating?
 
GrahamMandenoCommented:
You would generally want to do this if new records are added only occasionally.  In such a case I would start the form with AllowAdditions set to False, and place an "Add New Record" button on the form footer.

Use an event procedure like this:
Private Sub cmdAddNew_Click()
    Me.AllowAdditions = True
    DoCmd.GoToRecord Record:=acNewRec
    Me.[NameOfFirstControl].SetFocus
End Sub

Open in new window

You will also want to reset after the new record has been added:
Private Sub Form_Current()
    If Me.AllowAdditions Then
        If Not Me.NewRecord Then Me.AllowAdditions = False
    End If
End Sub

Open in new window

Graham Mandeno [Access MVP since 1996]
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Not really - the New Row is always shown if the user can Add new records to the form's recordset.

You could perhaps toggle the AllowAdd property, but I assume you want to do this on the last filled row, and Access has no concept of that - it's not Excel, so you can't really refer to "the row above/below" like you do in Excel. If you have some sort of marker - like an ID field, or perhaps a Sequence number - then you might be able to determine the last number showing on the form, and use the AllowAdd property ... but that's tenuous, at best.

Besides, users really don't like things that appear and disappear at random.
0
 
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Author Commented:
Thank you gentlemen that helped.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.