By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

how do you get data fields to carry over to a new record?

P: 5
Is there a simple way, without setting up a module, to get certain data fields to carry over to a new record as well in MS Access 2003. I've tried alot of modifications to the "default value" but none of them seem to work.

If anyone can help me out it would be greatly appreciated.
Jun 5 '07 #1
Share this Question
Share on Google+
13 Replies


ADezii
Expert 5K+
P: 8,597
Is there a simple way, without setting up a module, to get certain data fields to carry over to a new record as well in MS Access 2003. I've tried alot of modifications to the "default value" but none of them seem to work.

If anyone can help me out it would be greatly appreciated.
  1. Do you want ALL Fields carried over to the New Record or selective ones?
  2. Do you want these values automatically transferred over to the New Record, or when you enter these Fields?
  3. Once data is entered into a Field, does it become the new default Value for that Field?
Jun 5 '07 #2

Rabbit
Expert Mod 10K+
P: 12,315
Is there a simple way, without setting up a module, to get certain data fields to carry over to a new record as well in MS Access 2003. I've tried alot of modifications to the "default value" but none of them seem to work.

If anyone can help me out it would be greatly appreciated.
Does this table have a unique field that increments for each record added?
If it does then you can use a DMax embedded in a DLookup.
Jun 5 '07 #3

P: 5
  1. Do you want ALL Fields carried over to the New Record or selective ones?
  2. Do you want these values automatically transferred over to the New Record, or when you enter these Fields?
  3. Once data is entered into a Field, does it become the new default Value for that Field?
Sorry for being unclear before:

I only need selective fields to be carried over, not all.

I'm actually using a form so, when the user decides to insert a new record, I want certain fields from the previous record to carry over.

Yes, once the values in the selective fields are modified on the form, i want those value to become the new default values.
Jun 5 '07 #4

P: 5
Does this table have a unique field that increments for each record added?
If it does then you can use a DMax embedded in a DLookup.
No, unfortunately the records do not have any fields like that.
Jun 5 '07 #5

Rabbit
Expert Mod 10K+
P: 12,315
You'll probably have to add one then, unless ADezii has another idea.
Jun 5 '07 #6

P: 5
Ok i've found that solution for those of you with a similar problem, google "previous record" instead of "carry over", it works alot better, anyways, i found the solution in another forum there.

http://www.thescripts.com/forum/thread203454.html

incase it doesnt work here is the main thing you need:

It *is* a field property.

In the AfterUpdate event of the control (let's say it is called
theValue), put

theValue.defaultvalue = theValue.value

If theValue is text, do this:

theValue.defaultvalue = "'" & theValue.value & "'"
http://www.thescripts.com/forum/thread203454.html
Jun 5 '07 #7

Rabbit
Expert Mod 10K+
P: 12,315
Ok i've found that solution for those of you with a similar problem, google "previous record" instead of "carry over", it works alot better, anyways, i found the solution in another forum there.

http://www.thescripts.com/forum/thread203454.html

incase it doesnt work here is the main thing you need:



http://www.thescripts.com/forum/thread203454.html
This solution uses a code module which is what you wanted to avoid in the first place.
Jun 5 '07 #8

ADezii
Expert 5K+
P: 8,597
Sorry for being unclear before:

I only need selective fields to be carried over, not all.

I'm actually using a form so, when the user decides to insert a new record, I want certain fields from the previous record to carry over.

Yes, once the values in the selective fields are modified on the form, i want those value to become the new default values.
Only a couple of lines of Code will do the trick for you.
  1. For each Control that you wish to carry over its value, set the Control's Tag Property to Carry.
  2. Place this code in the AfterUpdate() Event of the Form.
  3. For each Control that you elected to carry over, set its Tag Property to Carry, its Default Value will be reset and will subsequently appear in New Record mode.
  4. Let me know how you make out with this.
Expand|Select|Wrap|Line Numbers
  1. Dim ctl As Control
  2.  
  3. For Each ctl In Me.Controls
  4.   If ctl.Tag = "Carry" Then
  5.     ctl.DefaultValue = "'" & ctl.Value & "'"
  6.   End If
  7. Next
Jun 5 '07 #9

ADezii
Expert 5K+
P: 8,597
Ok i've found that solution for those of you with a similar problem, google "previous record" instead of "carry over", it works alot better, anyways, i found the solution in another forum there.

http://www.thescripts.com/forum/thread203454.html

incase it doesnt work here is the main thing you need:



http://www.thescripts.com/forum/thread203454.html
Be advised that this approach does not take into consideration the carrying over of values for 'selective' Controls, see my response in Message #9.
Jun 5 '07 #10

FishVal
Expert 2.5K+
P: 2,653
Be advised that this approach does not take into consideration the carrying over of values for 'selective' Controls, see my response in Message #9.
Why?

This is an Expression handler of AfterUpdate event on a particular control.
Thus it is very selective by its nature and it fits the need "not to create module". Personally I prefer coding but I'm really appreciating this simple and elegant solution.

:)
Jun 5 '07 #11

Rabbit
Expert Mod 10K+
P: 12,315
Why?

This is an Expression handler of AfterUpdate event on a particular control.
Thus it is very selective by its nature and it fits the need "not to create module". Personally I prefer coding but I'm really appreciating this simple and elegant solution.

:)
Problem is that their solution doesn't work unless it's in the form's code module.
Jun 5 '07 #12

FishVal
Expert 2.5K+
P: 2,653
Problem is that their solution doesn't work unless it's in the form's code module.
Big deal. A good village is burning beautifully.
Of course this doesn't work. Long live VBA. :)
Jun 6 '07 #13

Rabbit
Expert Mod 10K+
P: 12,315
Big deal. A good village is burning beautifully.
Of course this doesn't work. Long live VBA. :)
lol, I have no problem with VBA. It's just that the poster originally wanted to avoid VBA.
Jun 6 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.