• Data Forms

    Author
    Topic
    #462968

    Good evening

    I am trying to record a macro to make a data form entry sheet. I have about 15 columns but no matter where I place the cursor when I start it gives the error message below. Can I stop this so that when I click my button the data form comes straight up?

    Viewing 1 reply thread
    Author
    Replies
    • #1180046

      Set up your data table in such a way that Excel doesn’t have to guess at its structure or ask you about it:

      – The first row of the table should contain column headings.
      – The column headings should not take up more than one row.
      – If the row with the column headings is not the first row of the worksheet, the row above it should be blank.
      – The row below the row with the column headings should *not* be entirely blank.
      – Preferably, format the row with the column headings in a way that distinguishes it from the rows below, e.g. by making the text bold.

      • #1180122

        Set up your data table in such a way that Excel doesn’t have to guess at its structure or ask you about it:

        – The first row of the table should contain column headings.
        – The column headings should not take up more than one row.
        – If the row with the column headings is not the first row of the worksheet, the row above it should be blank.
        – The row below the row with the column headings should *not* be entirely blank.
        – Preferably, format the row with the column headings in a way that distinguishes it from the rows below, e.g. by making the text bold.

        Hi Hans

        Thanks for that, it seems as though placing numbers 1 through 28 under the column headings did what I wanted but I now have another problem (not sure if I should post as a new topic)

        I have recorded a macro ‘CompleteInvoice’ with the following steps, Open data form, click ‘new’ (so that the numbers I have entered don’t show) and then close.

        I have assigned the Macro to a button but it is now giving me an error, when I debug this is what I get this which highlights ActiveSheet.ShowDataForm

        Sub CompleteInvoice()

        ‘ CompleteInvoice Macro
        ‘ Macro recorded 06/10/2009 by steve

        ‘ Keyboard Shortcut: Ctrl+o

        ActiveSheet.ShowDataForm
        End Sub

        ??

        • #1180123

          Without seeing the workbook I have no idea why the error occurs.

          Keep in mind that the macro recorder only records opening the data form. It does not record any actions that you perform while the data form is open, such as clicking New, and there is no VBA equivalent of performing actions in the data form. You could simulate pressing Alt+W (the keyboard shortcut for the New button):

          Code:
            SendKeys "%w"
            ActiveSheet.ShowDataForm
    • #1180137

      If your data does not start in the range A1:B2 and is not named Database, then you will get that error.

    Viewing 1 reply thread
    Reply To: Data Forms

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: