Remembering a field value for later use

D

Derek

Hi

I have a field in a form whose value I want to transfer or
copy to a different field in a new record when I start a
new blank record. I've tried creating a VBA proceedure for
a new record button it goes like this:

Private Sub New_Record_Click()
Dim CopyValue As Integer
CopyValue = IntOldFieldValue
DoCmd.GoToRecord , , acNewRec
IntNewFieldValue = CopyValue
Exit_New_Record_Click:
Exit Sub
End Sub

I have no idea why this does not work help!
 
D

Derek

Hi
Actual code is:

I'm not sure if that makes it any clearer but what I do is
filter the records on a form to show only relevant records
Ie. Customers, Suppliers etc which are stored in the same
table. (I could have separate forms for suppliers and
customers but I hate having to go to a new form or table
just to get a phone number) I filter the records with an
option group called "Filter" whos values are 1 for Sales
and 2 for suppliers depending on option selected. The
values 1 or 2 are stored in CorS field. But it is common
when entering new contact details in a new record to
forget to enter the values 1 or 2 that diferenciate
between Customer and Supplier in the CorS field. If I
could automatically enter the value from the filter field
into the CorS field of a new record this could be avoided.
Any help?
Dim CopyValue As Integer
CopyValue = IntOldFieldValue
 
D

Derek

Hi
I am very sorry that I have not replied. Been on Hols did
not get chance before but thank you for your help.

I have no idea if after all this time this question is
still considered active so I have asked the question again
in a new message. Is this OK? I know multiple strings are
not appreciated. But after how long is a message lost?

All I need is a way to save the value in one current
record field and insert it into a field on a new record
automatically. It would be nice to be able to reverse this
if the new record is not subsequently used, this would
save a lot of new records being created when the "start
new record" button is pressed accidentaly.
 
Top