How to Use Access and Enter Data on One Form to Prefill Another

Written by jaime avelar
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Use Access and Enter Data on One Form to Prefill Another
Learn how to prefill a form while entering data in another form using VBA. (binary code tunnel and a book with blank pages image by Stasys Eidiejus from Fotolia.com)

Knowing how to prefill a form while entering data on another in Microsoft Office Access can save time when you need multiple forms with the same data entered. Access is a relational database management system offered in the Microsoft Office suite. Visual Basic for Applications (VBA) is a programming language used in Access to automate manual processes. A form is a Graphical User Interface (GUI) used in Access to provide a user-friendly way to enter data into the database.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Open Microsoft Office Access 2007, click "Blank Database" then select "Create." From the "Create" tab, select "Form Design." Click the "Text Box" control from the "Controls" pane then click on the form and create a text box control. Click the new text box control and press "Ctrl" and "C" simultaneously to copy the control.

  2. 2

    Press "Ctrl" and "V" two times to paste two new text box controls on the form. Press "Ctrl" and "S" then click "OK" to save the form. Create a new form and create three new text controls using the same process. Press "Ctrl" and "S" then click "OK" to save the form.

  3. 3

    Right-click the Form1 and select "Properties." Under "Selection type:," select "Form." Select "[Event Procedure]" next to "On Load" and click the ellipsis (...) to open the Microsoft Visual Basic Window.

  4. 4

    Press "Ctrl" and "A" then press "Delete" to remove existing code.

    Copy and paste the code below into your module:

    Private Sub Form_Load()

    DoCmd.OpenForm "Form2", ac Normal
    

    End Sub

    Private Sub Text0_Change()

    Forms!Form2!Text0.SetFocus
    
    Forms!Form2!Text0.Text = Me.Text0.Text
    

    End Sub

    Private Sub Text1_Change()

    Forms!Form2!Text1.SetFocus
    
    Forms!Form2!Text1.Text = Me.Text1.Text
    

    End Sub

    Private Sub Text2_Change()

    Forms!Form2!Text2.SetFocus
    
    Forms!Form2!Text2.Text = Me.Text2.Text
    

    End Sub

  5. 5

    Switch back to the Microsoft Access Window and Right-click "Form1" and select "Form View."

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.