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  

Copy and paste buttons in form



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2006, 08:27 PM posted to microsoft.public.access.forms
E-mail report using Lotus Notes rather t
external usenet poster
 
Posts: 105
Default Copy and paste buttons in form

Hi, I am trying to create a copy and paste button in my form. I have a Close
Form button and it works but I am trying to make a copy, paste and
reset/clear buttons in my form. I am trying to make the person entering data
in a form easier with the copy and paste buttons. First, I type/fill the
information in my form but I will be typing same information over and over
again in my form only changing one thing like item code of a product. Can
someone please tell me how I can create a button so that I can copy the
information in the clipboard with copy button and paste (button) it in a new
empty form (its the same form but next page empty entry form).

Buttons:
1. Copy Button
2. Paste Button
3. Clear/reset button

I prefer macro if possible because I am not very good with VB.

Thanks you in advance for all your help.
  #2  
Old August 30th, 2006, 08:50 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Copy and paste buttons in form

Copy/Paste is an ugly word, but that is not really what you are doing here.
Sorry, but what you want requires VBA. A Macro wont do this, it is too
involved.
The VBA to do this is not that difficult. The example below is not what a
professional would do, but it will get the job done and you will learn a
little VBA from it.

To start, you may need to know how to put VBA in a control event.
Open the form in design view.

Create the button.

Open the Properties dialog either by clicking the properties icon on the
tool bar or right click and select properties form the drop down. The button
needs to be selected when you do either of these.

Select the Events tab.
Click in the On Click box. You will then see a small button with 3 dots.
Click it.
Select Code Builder.
the VBA editor will open with the Sub and End Sub statements for the event
and the cursor positioned on the first line.
Now, you are ready to begin coding.

First, for the Copy button.
You will need one line of code for each text box or other control on your
form where data will be entered. What we are going to do it is use the Tag
property of each control to store the current value of the control in. We
will use that later in the Paste button code. Here are a couple of lines as
example:

Me.Text0.Tag = Me.Text0
Me.Text1.Tag = Me.Text1
etc.

Now for the Paste Button, we will add a new record and paste all the values
from the tag properties of the controls into the control. Here is the code:

docmd.GoToRecord ,,acNewRec
Me.Text0 = Me.Text0.Tag
Me.Text1 = Me.Text1.Tag
etc.

"E-mail report using Lotus Notes rather t" wrote:

Hi, I am trying to create a copy and paste button in my form. I have a Close
Form button and it works but I am trying to make a copy, paste and
reset/clear buttons in my form. I am trying to make the person entering data
in a form easier with the copy and paste buttons. First, I type/fill the
information in my form but I will be typing same information over and over
again in my form only changing one thing like item code of a product. Can
someone please tell me how I can create a button so that I can copy the
information in the clipboard with copy button and paste (button) it in a new
empty form (its the same form but next page empty entry form).

Buttons:
1. Copy Button
2. Paste Button
3. Clear/reset button

I prefer macro if possible because I am not very good with VB.

Thanks you in advance for all your help.

  #3  
Old August 30th, 2006, 10:25 PM posted to microsoft.public.access.forms
E-mail report using Lotus Notes rather t
external usenet poster
 
Posts: 105
Default Copy and paste buttons in form

Private Sub Command36_Click()
Me.Part_Number0.Tag = Me.Part_Number0
Me.Description1.Tag = Me.Description1
Me.Registration_Number2.Tag = Me.Registration_Number2

I typed this as you had indicated and I only did 3 text field and it doesn't
work. Also do I have to us _ for (Registration_Number)? Please help. I am
not good with VB at all. Also do I need to start with:

Me.Text0.Tag = Me.Text.0 (is the 0 a number or alphabet? and do I need
to us 0 instead of 1 because my first field is an autonumber and I don't want
to copy that)




"E-mail report using Lotus Notes rather t" wrote:

Hi, I am trying to create a copy and paste button in my form. I have a Close
Form button and it works but I am trying to make a copy, paste and
reset/clear buttons in my form. I am trying to make the person entering data
in a form easier with the copy and paste buttons. First, I type/fill the
information in my form but I will be typing same information over and over
again in my form only changing one thing like item code of a product. Can
someone please tell me how I can create a button so that I can copy the
information in the clipboard with copy button and paste (button) it in a new
empty form (its the same form but next page empty entry form).

Buttons:
1. Copy Button
2. Paste Button
3. Clear/reset button

I prefer macro if possible because I am not very good with VB.

Thanks you in advance for all your help.

  #4  
Old August 30th, 2006, 11:10 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Copy and paste buttons in form

You are takinig it too literally, I only used those as examples. You code
should look more like:

Me.Part_Number.Tag = Me.Part_Number
Me.Description.Tag = Me.Description
Me.Registration_Number.Tag = Me.Registration_Number


This question
Also do I have to us _ for (Registration_Number)?
I don't understand, can you post more detail?

"E-mail report using Lotus Notes rather t" wrote:

Private Sub Command36_Click()
Me.Part_Number0.Tag = Me.Part_Number0
Me.Description1.Tag = Me.Description1
Me.Registration_Number2.Tag = Me.Registration_Number2

I typed this as you had indicated and I only did 3 text field and it doesn't
work. Also do I have to us _ for (Registration_Number)? Please help. I am
not good with VB at all. Also do I need to start with:

Me.Text0.Tag = Me.Text.0 (is the 0 a number or alphabet? and do I need
to us 0 instead of 1 because my first field is an autonumber and I don't want
to copy that)




"E-mail report using Lotus Notes rather t" wrote:

Hi, I am trying to create a copy and paste button in my form. I have a Close
Form button and it works but I am trying to make a copy, paste and
reset/clear buttons in my form. I am trying to make the person entering data
in a form easier with the copy and paste buttons. First, I type/fill the
information in my form but I will be typing same information over and over
again in my form only changing one thing like item code of a product. Can
someone please tell me how I can create a button so that I can copy the
information in the clipboard with copy button and paste (button) it in a new
empty form (its the same form but next page empty entry form).

Buttons:
1. Copy Button
2. Paste Button
3. Clear/reset button

I prefer macro if possible because I am not very good with VB.

Thanks you in advance for all your help.

 




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 07:44 AM.


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