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:
Other People Are Reading
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.
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.
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.
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
Private Sub Text0_Change()
Forms!Form2!Text0.SetFocus Forms!Form2!Text0.Text = Me.Text0.Text
Private Sub Text1_Change()
Forms!Form2!Text1.SetFocus Forms!Form2!Text1.Text = Me.Text1.Text
Private Sub Text2_Change()
Forms!Form2!Text2.SetFocus Forms!Form2!Text2.Text = Me.Text2.Text
Switch back to the Microsoft Access Window and Right-click "Form1" and select "Form View."
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for