Entry of data in form

E

Eric

Dear all

I've a form that allow user to input some data. i wonder if there is a way
that i can keep some of the data of pervious records for next one. So, the
user do not have to repeat again and again

Thanks for your recommendation

Eric
 
J

John W. Vinson

Dear all

I've a form that allow user to input some data. i wonder if there is a way
that i can keep some of the data of pervious records for next one. So, the
user do not have to repeat again and again

Thanks for your recommendation

Eric

You can use a little vba code in the AfterUpdate event of a control:

Private Sub controlname_AfterUpdate()
Me.ControlName.DefaultValue = """" & Me.ControlName & """"
End Sub

That's four quotemarks before and after. This will set the default value of
the control to whatever the user entered, making the value "sticky" until it's
overtyped.

It's possible that your table design needs attention; if you *routinely* have
many repeating fields, you may need to normalize the data into two tables
related one to many. You can store the "one" side data in one table and the
"many" side data in the second table and use a form/subform to enter it.
 
L

Linq Adams via AccessMonster.com

In your form, you can use the AfterUpdate event of the control holding your
data to set the DefaultValue for the field. From that time forward, until you
either manually change the data or close your form, the data will be entered
automatically in each new record. Do for each control/textbox whose data you
want to bring forward:

Private Sub ControlName_AfterUpdate()
Me.ControlName.DefaultValue = """" & Me.ControlName.Value & """"
End Sub

Just replace ControlName with the actual name(s) of your control(s).
 
E

Eric

Linq
Thanks

if the field that is going to repeat in each record is the field "remarks"

I should write :
Private Sub remarks_AfterUpdate()
Me.remarks.DefaultValue = """" & Me.remarks & """"
End Sub

or

Private Sub ControlName_AfterUpdate()
Me.ControlName.DefaultValue = """" & remarks.Value & """"
 
D

Douglas J. Steele

Private Sub remarks_AfterUpdate()
Me.remarks.DefaultValue = """" & Me.remarks & """"
End Sub
 

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