Repeat data input within forms, Access 2003

G

Guest

Hi All,

I need help on how to setup auto repeat entry in a form with in Access 2003,
I know I can press CTRL + ' will enter in the data from the previous record.
But I can not find anywhere how to do this automaticly within the properties
of form text boxes & combo boxes.

Please help as I have lots of data to punch in with a number of fields being
the same.

Thanks.

Sean.
 
G

Guest

Sorry I am new to this with Access. I have written basic macros in Excel but
have not done any in Access. Do you have an example of one that I would be
able to use?????

Thanks for helping.
Sean.
 
J

John Spencer

One way to do this is to add code the the after update event of the form
that sets the default to the current value in the control.

Sample code:
Private Sub Form_AfterUpdate()
Me.fText.DefaultValue = "=" & Chr(34) & Me.fText & Chr(34)
Me.fLink.DefaultValue = "=" & Chr(34) & Me.fLink & Chr(34)
Me.fSubject.DefaultValue = "=" & Chr(34) & Me.fSubject & Chr(34)
End Sub

In the form, show properties of the form,
--click on the Events tab,
-- enter [Event Procedure] in the After Update,
-- Click on the three dot button at the end of the box
-- The VBA window will open with the cursor in position to enter code for
the event
-- Enter code similar to the above replace fText with the name of your
control on the form.


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top