A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Preautopopulate Form record



 
 
Thread Tools Display Modes
  #1  
Old August 26th, 2008, 07:41 PM posted to microsoft.public.access.forms
JaneM
external usenet poster
 
Posts: 15
Default Preautopopulate Form record

How do I create a new record in a form copying (autopopulating) data from the
previous record? I already have created three forms. Would I have to redo
forms? Is this possible? Would I need to use code?
--
Jane Marlotty
  #2  
Old August 26th, 2008, 08:16 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Preautopopulate Form record

Jane

You've described "how".

Now, "why?" What would having a new record that was an essential duplicate
of the previous record allow you to do?

(often when folks are trying to copy a previous record it is because they
are used to working in Excel rather than Access).

Regards

Jeff Boyce
Microsoft Office/Access MVP


"JaneM" wrote in message
...
How do I create a new record in a form copying (autopopulating) data from
the
previous record? I already have created three forms. Would I have to redo
forms? Is this possible? Would I need to use code?
--
Jane Marlotty



  #3  
Old August 26th, 2008, 08:21 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Preautopopulate Form record

If, by "copying (autopopulating) data from the previous record" you mean can
you enter one record, move to a new record and have certain fields populated
with the same values from the previous record, yes you can and yes, it'll
require code.

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. The syntax varies slightly, depending on
the datatype of the data:

For Date fields

Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
End If
End Sub

For Text fields

Private Sub YourTextControlName_AfterUpdate()
If Not IsNull(Me.YourTextControlName.Value) Then
YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value &
""""
End If
End Sub

For Numeric fields

Private Sub YourNumericControlName_AfterUpdate()
If Not IsNull(Me.YourNumericControlName.Value) Then
YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
End If
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200808/1

  #4  
Old August 26th, 2008, 09:00 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Preautopopulate Form record

Your question is, of course, pertinent if the OP's intention is to carry
forward ***all*** data from the previous record, but not if he only wants to
carry forward certain fields. He doesn't really make this clear. People doing
"batch" data entries often find themselves entering ***some*** fields over
and over again, and can benefit from the technique I offered.

An example would be the weekly entering of delivery tickets, where the
operator might have to enter dozens of tickets for a given date, then move on
to another date and do the same.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200808/1

  #5  
Old August 26th, 2008, 11:23 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Preautopopulate Form record

Yup, I've used the DefaultValue approach to carry values forward into new
records, and only for a limited number of controls.

Without more information, it's hard to offer more specific suggestions...

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Linq Adams via AccessMonster.com" u28780@uwe wrote in message
news:89430893e77ec@uwe...
Your question is, of course, pertinent if the OP's intention is to carry
forward ***all*** data from the previous record, but not if he only wants
to
carry forward certain fields. He doesn't really make this clear. People
doing
"batch" data entries often find themselves entering ***some*** fields over
and over again, and can benefit from the technique I offered.

An example would be the weekly entering of delivery tickets, where the
operator might have to enter dozens of tickets for a given date, then move
on
to another date and do the same.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200808/1



  #6  
Old August 27th, 2008, 02:04 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Preautopopulate Form record

True, Jeff! Just had a conversation elsewhere, today, noting that those of us
who answer questions on a regular basis spend at least 25-30% of our time not
***solving problems*** but rather trying to find out, from the OPs, ***what
the problem actually is***!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200808/1

  #7  
Old August 27th, 2008, 02:26 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Preautopopulate Form record

On Wed, 27 Aug 2008 01:04:10 GMT, "Linq Adams via AccessMonster.com"
u28780@uwe wrote:

True, Jeff! Just had a conversation elsewhere, today, noting that those of us
who answer questions on a regular basis spend at least 25-30% of our time not
***solving problems*** but rather trying to find out, from the OPs, ***what
the problem actually is***!


In my experience, that applies in all areas of life, not just technical.
Correctly identifying the problem is not only essential - often, just (clearly
and correctly) stating the problem makes the solution obvious.

Reviewing some of the longer threads in these groups makes it clear that many
problems here don't get stated clearly... and indeed could be solved in
moments if they were!
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.