Insert Blank Row

Posted on 2006-04-21
Last Modified: 2012-08-13
Simple question but I am too burnt out today to remember the simple answer.  How can you insert a blank row into an access table.  My table is called tmpMigration2 and I want to do this in the VBA.
Question by:flfmmqp
    LVL 58

    Accepted Solution


    You can't "insert" in tables, only "append". And normally, you can't have a "blank" row, as one field at least should contain something -- e.g. the  key field.

    Perhaps you meant: in a report? Or did you mean: how to add a new record in a table using VB?

    LVL 74

    Expert Comment

    by:Jeffrey Coachman

    harfang is correct.

    Can you explain why you need this blank Record?

    I mean, you could very well insert a null into one of the fields, than save the record.
    In effect creating a Blank Record.
    Like so:

    Private Sub cmdInsertBlank_Click()
        'Creates a new record
        DoCmd.GoToRecord , , acNewRec
        'Inserts a Null in one Field
        Me.AnyFieldInYourForm = Null
        'Saves the record
        DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
        'Displays a message after inserting the blank record,
        'so the user won't think it is a "New" record, and start entering data.
        MsgBox "Here is your Blank Record"
    End Sub

    But this is non-standard and might cause problems.

    But again, Why do you need this functionality?

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    754 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

    26 Experts available now in Live!

    Get 1:1 Help Now