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

Posted on 2012-09-13
Last Modified: 2012-10-02
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...?
Question by:ruavol2
    LVL 84

    Assisted Solution

    by:Scott McDaniel (Microsoft Access MVP - EE MVE )
    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.
    LVL 20

    Accepted Solution

    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
    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]

    Author Closing Comment

    Thank you gentlemen that helped.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Many companies are making the switch from Microsoft to Google Apps ( Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now