PC Review


Reply
Thread Tools Rate Thread

Copy fields from one record to another

 
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      21st Jun 2005
I have a form. I would like to create a button, that will copy the data from
a set group of fields and then let the user find the record that they want to
paste the data to and then paste the data in the corresponding fields in that
record. I already have a Find button. If it is easier, there can be 2
buttons, copy and paste. I don't know if the copy button could copy the data
and then the user could use the existing Find button to find the record and
then the paste button could paste into the new record. Any ideas would be
great. Thanks. Matt.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      21st Jun 2005
you can try that, few stages
1. create varible in the form declaration
dim MyField1 as string,MyField2 as number, MyField3 as string .... (as many
that you need)
2. on the copy button assign the values from the fields in the form to the
variable you created

MyField1=me.Field1
MyField2=me.Field2
MyField3=me.Field3

you can copy only the records that are relevant

3. on the paste button enter the code.

me.Field1=MyField1
me.Field2=MyField2
me.Field3=MyField3

that way you can repeat the paste as many time that you would like with the
same values.



"Matt" wrote:

> I have a form. I would like to create a button, that will copy the data from
> a set group of fields and then let the user find the record that they want to
> paste the data to and then paste the data in the corresponding fields in that
> record. I already have a Find button. If it is easier, there can be 2
> buttons, copy and paste. I don't know if the copy button could copy the data
> and then the user could use the existing Find button to find the record and
> then the paste button could paste into the new record. Any ideas would be
> great. Thanks. Matt.

 
Reply With Quote
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      22nd Jun 2005
What is the best way to prompt the user if they really want to do this
procedure and then based on whether they answer yes or no, run the code or
exit sub? Thanks. Matt

"Ofer" wrote:

> you can try that, few stages
> 1. create varible in the form declaration
> dim MyField1 as string,MyField2 as number, MyField3 as string .... (as many
> that you need)
> 2. on the copy button assign the values from the fields in the form to the
> variable you created
>
> MyField1=me.Field1
> MyField2=me.Field2
> MyField3=me.Field3
>
> you can copy only the records that are relevant
>
> 3. on the paste button enter the code.
>
> me.Field1=MyField1
> me.Field2=MyField2
> me.Field3=MyField3
>
> that way you can repeat the paste as many time that you would like with the
> same values.
>
>
>
> "Matt" wrote:
>
> > I have a form. I would like to create a button, that will copy the data from
> > a set group of fields and then let the user find the record that they want to
> > paste the data to and then paste the data in the corresponding fields in that
> > record. I already have a Find button. If it is easier, there can be 2
> > buttons, copy and paste. I don't know if the copy button could copy the data
> > and then the user could use the existing Find button to find the record and
> > then the paste button could paste into the new record. Any ideas would be
> > great. Thanks. Matt.

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      22nd Jun 2005
On the onclick event of the paste button write the code

IF msgbox ("Continue with paste?",vbOKCancel)=vbOK then
me.Field1=MyField1
me.Field2=MyField2
me.Field3=MyField3
End If

When the user choose to cancel it would exit without the paste action

"Matt" wrote:

> What is the best way to prompt the user if they really want to do this
> procedure and then based on whether they answer yes or no, run the code or
> exit sub? Thanks. Matt
>
> "Ofer" wrote:
>
> > you can try that, few stages
> > 1. create varible in the form declaration
> > dim MyField1 as string,MyField2 as number, MyField3 as string .... (as many
> > that you need)
> > 2. on the copy button assign the values from the fields in the form to the
> > variable you created
> >
> > MyField1=me.Field1
> > MyField2=me.Field2
> > MyField3=me.Field3
> >
> > you can copy only the records that are relevant
> >
> > 3. on the paste button enter the code.
> >
> > me.Field1=MyField1
> > me.Field2=MyField2
> > me.Field3=MyField3
> >
> > that way you can repeat the paste as many time that you would like with the
> > same values.
> >
> >
> >
> > "Matt" wrote:
> >
> > > I have a form. I would like to create a button, that will copy the data from
> > > a set group of fields and then let the user find the record that they want to
> > > paste the data to and then paste the data in the corresponding fields in that
> > > record. I already have a Find button. If it is easier, there can be 2
> > > buttons, copy and paste. I don't know if the copy button could copy the data
> > > and then the user could use the existing Find button to find the record and
> > > then the paste button could paste into the new record. Any ideas would be
> > > great. Thanks. Matt.

 
Reply With Quote
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      22nd Jun 2005
Thanks alot. Everything you've said works great.

"Ofer" wrote:

> On the onclick event of the paste button write the code
>
> IF msgbox ("Continue with paste?",vbOKCancel)=vbOK then
> me.Field1=MyField1
> me.Field2=MyField2
> me.Field3=MyField3
> End If
>
> When the user choose to cancel it would exit without the paste action
>
> "Matt" wrote:
>
> > What is the best way to prompt the user if they really want to do this
> > procedure and then based on whether they answer yes or no, run the code or
> > exit sub? Thanks. Matt
> >
> > "Ofer" wrote:
> >
> > > you can try that, few stages
> > > 1. create varible in the form declaration
> > > dim MyField1 as string,MyField2 as number, MyField3 as string .... (as many
> > > that you need)
> > > 2. on the copy button assign the values from the fields in the form to the
> > > variable you created
> > >
> > > MyField1=me.Field1
> > > MyField2=me.Field2
> > > MyField3=me.Field3
> > >
> > > you can copy only the records that are relevant
> > >
> > > 3. on the paste button enter the code.
> > >
> > > me.Field1=MyField1
> > > me.Field2=MyField2
> > > me.Field3=MyField3
> > >
> > > that way you can repeat the paste as many time that you would like with the
> > > same values.
> > >
> > >
> > >
> > > "Matt" wrote:
> > >
> > > > I have a form. I would like to create a button, that will copy the data from
> > > > a set group of fields and then let the user find the record that they want to
> > > > paste the data to and then paste the data in the corresponding fields in that
> > > > record. I already have a Find button. If it is easier, there can be 2
> > > > buttons, copy and paste. I don't know if the copy button could copy the data
> > > > and then the user could use the existing Find button to find the record and
> > > > then the paste button could paste into the new record. Any ideas would be
> > > > great. Thanks. Matt.

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      22nd Jun 2005
Any time, good luck with the rest

"Matt" wrote:

> Thanks alot. Everything you've said works great.
>
> "Ofer" wrote:
>
> > On the onclick event of the paste button write the code
> >
> > IF msgbox ("Continue with paste?",vbOKCancel)=vbOK then
> > me.Field1=MyField1
> > me.Field2=MyField2
> > me.Field3=MyField3
> > End If
> >
> > When the user choose to cancel it would exit without the paste action
> >
> > "Matt" wrote:
> >
> > > What is the best way to prompt the user if they really want to do this
> > > procedure and then based on whether they answer yes or no, run the code or
> > > exit sub? Thanks. Matt
> > >
> > > "Ofer" wrote:
> > >
> > > > you can try that, few stages
> > > > 1. create varible in the form declaration
> > > > dim MyField1 as string,MyField2 as number, MyField3 as string .... (as many
> > > > that you need)
> > > > 2. on the copy button assign the values from the fields in the form to the
> > > > variable you created
> > > >
> > > > MyField1=me.Field1
> > > > MyField2=me.Field2
> > > > MyField3=me.Field3
> > > >
> > > > you can copy only the records that are relevant
> > > >
> > > > 3. on the paste button enter the code.
> > > >
> > > > me.Field1=MyField1
> > > > me.Field2=MyField2
> > > > me.Field3=MyField3
> > > >
> > > > that way you can repeat the paste as many time that you would like with the
> > > > same values.
> > > >
> > > >
> > > >
> > > > "Matt" wrote:
> > > >
> > > > > I have a form. I would like to create a button, that will copy the data from
> > > > > a set group of fields and then let the user find the record that they want to
> > > > > paste the data to and then paste the data in the corresponding fields in that
> > > > > record. I already have a Find button. If it is easier, there can be 2
> > > > > buttons, copy and paste. I don't know if the copy button could copy the data
> > > > > and then the user could use the existing Find button to find the record and
> > > > > then the paste button could paste into the new record. Any ideas would be
> > > > > great. Thanks. Matt.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy some fields in current record into new record? Chris Microsoft Access 4 12th Jul 2011 10:00 PM
Copy of record not copying all fields jturn00 Microsoft Access Form Coding 4 5th Nov 2007 04:18 PM
Re: Conditionally copy all fields to new record John Vinson Microsoft Access 0 15th Sep 2004 01:11 AM
Copy fields from one record into another record in same database GINNY Microsoft Access Form Coding 2 15th Apr 2004 01:04 PM
Copy data in fields to new record John P Microsoft Access Forms 1 13th Jan 2004 07:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 AM.