473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Copy information from one form to another

I have two forms, the first is used to create quotes for our
customers, which has an autonumber field in it. The second, is an
invoice form, and needs to have the quotes' autonumber in it to keep
the two together in a sense. When the user goes from the quote form
to the invoice form, how can I create a command button to copy the
quotes' number to the invoice form?

Thanks for your help!

Rob
Nov 12 '05 #1
6 8013
As long as the other form is still open, you can simply refer to the value of the control
holding the number.

Example:
NumberToCopy = Forms!frmFirstForm!txtAutoNumberControl

--
Wayne Morgan
"Shade" <do*************@hotmail.com> wrote in message
news:5a**************************@posting.google.c om...
I have two forms, the first is used to create quotes for our
customers, which has an autonumber field in it. The second, is an
invoice form, and needs to have the quotes' autonumber in it to keep
the two together in a sense. When the user goes from the quote form
to the invoice form, how can I create a command button to copy the
quotes' number to the invoice form?

Thanks for your help!

Rob

Nov 12 '05 #2
I'm sorry, I guess I should've said that the second form (invoice)
will NOT be open, and I'll need a command to copy the info, open the
next form, and paste it into said form.

Thanks Again!

Rob

"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<zO****************@newssvr17.news.prodigy.co m>...
As long as the other form is still open, you can simply refer to the value of the control
holding the number.

Example:
NumberToCopy = Forms!frmFirstForm!txtAutoNumberControl

--
Wayne Morgan
"Shade" <do*************@hotmail.com> wrote in message
news:5a**************************@posting.google.c om...
I have two forms, the first is used to create quotes for our
customers, which has an autonumber field in it. The second, is an
invoice form, and needs to have the quotes' autonumber in it to keep
the two together in a sense. When the user goes from the quote form
to the invoice form, how can I create a command button to copy the
quotes' number to the invoice form?

Thanks for your help!

Rob

Nov 12 '05 #3
I do it this way:
Declare a Public Variable and hold the number to be copied in that.
For example

Public intCopyNum as Integer
============================
On the first form the command button will have the following code

Function cmdCopy_Click
intCopyNum = txtAutoNumberControl
Docmd.Openform "SecondForm"
End Function

In the "SecondForm", the Load event will have
txtNumCopied = intCopyNum

HTH

Sunil Korah

do*************@hotmail.com (Shade) wrote in message news:<5a**************************@posting.google. com>...
I'm sorry, I guess I should've said that the second form (invoice)
will NOT be open, and I'll need a command to copy the info, open the
next form, and paste it into said form.

Thanks Again!

Rob

"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<zO****************@newssvr17.news.prodigy.co m>...
As long as the other form is still open, you can simply refer to the value of the control
holding the number.

Example:
NumberToCopy = Forms!frmFirstForm!txtAutoNumberControl

--
Wayne Morgan
"Shade" <do*************@hotmail.com> wrote in message
news:5a**************************@posting.google.c om...
I have two forms, the first is used to create quotes for our
customers, which has an autonumber field in it. The second, is an
invoice form, and needs to have the quotes' autonumber in it to keep
the two together in a sense. When the user goes from the quote form
to the invoice form, how can I create a command button to copy the
quotes' number to the invoice form?

Thanks for your help!

Rob

Nov 12 '05 #4
While you may not want it showing, it can still be open. Try hiding the form instead of
closing it by setting its Visible property to False.

--
Wayne Morgan
"Shade" <do*************@hotmail.com> wrote in message
news:5a**************************@posting.google.c om...
I'm sorry, I guess I should've said that the second form (invoice)
will NOT be open, and I'll need a command to copy the info, open the
next form, and paste it into said form.

Nov 12 '05 #5
Sunil,

I am kind of learning Access as I go, so do I declare that public
variable in a module? That's what I've done, I named it
modCopyBetweenForms. Should I have done this? Is there anything else
I need to do if I have that command in a Module?

Also, in your function, your line starts with 'cmdCopy_click', is that
the actual command button itself, or is that a command in Access?

Thanks for all your help!

Rob

Wayne,

What if the command button opens the second form, copies the
information, and then closes the first form? Will that work?

Thanks again!

Rob
Nov 12 '05 #6
Rob,

First of all, I was away for some time and saw your message only now.
So I dont know whether you found out what you needed to in the
meantime.

do*************@hotmail.com (Shade) wrote in message news:<5a**************************@posting.google. com>...
Sunil,

I am kind of learning Access as I go, so do I declare that public
variable in a module? That's what I've done, I named it
modCopyBetweenForms. Should I have done this? Is there anything else
I need to do if I have that command in a Module?
Yes, the variable has to be in a module- in the 'General' section
right at the top. But is 'modCopyBetweenForms' a module or a
vatriable?
Also, in your function, your line starts with 'cmdCopy_click', is that
the actual command button itself, or is that a command in Access?
'cmdCopy_click' is the function attached to the command button called
'cmdCopy' , which means that whenever you click on cmdCopy command
button the function 'cmdCopy_click' executes. When you go into the
code view of the form (View->Code), select 'cmdCopy' from the left
dropdownbox and 'Click' from the right side dropdown box, access
automatically names that funcion 'cmdCopy_Click' (I am mentioning this
because you say you are just learning access)

HTH
Sunil Korah
Thanks for all your help!

Rob

Wayne,

What if the command button opens the second form, copies the
information, and then closes the first form? Will that work?

Thanks again!

Rob

Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mike | last post by:
I have a form that has a place for "Customer" and "CO-Customer" information. I want to put a button by the CO-Customer section that will copy the Address information from the Customer. Do I...
3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
5
by: NK | last post by:
Hi, We have a webpage that has a form available on the intranet. A user will have a window open that runs a different application open. When the user accesses the webpage and clicks a button we...
5
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
4
by: GiladP1 | last post by:
Hi, I want to copy protect my application. I want to limit its use for a given period of time, say 30 days, after which a license key will be needed. There are various issues to consider here...
22
by: Woody Splawn | last post by:
I am somewhat new to VS.net in general. As a result I am prone to make mistakes. When adding some new feature to a a form it would be nice if I could back it up before trying something that might...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
5
by: mbatestblrock | last post by:
I was wondering if it were possible to do this. I have a form that is used to input a ton of information and then I have a button on it it to export it into a word template to print out. Now I...
7
kcdoell
by: kcdoell | last post by:
Good morning everyone: I created a form and set the default view as a continuous form. Basically the form is displaying records in which the user can add or edit new ones. The record source for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.