473,387 Members | 1,876 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,387 software developers and data experts.

Copying Data

Hi,

I have a form that shows a job (computer maintainence system) i have a
button that opens another form that allows the user to log a call to
the manufacturer from the log form. I need access to copy the ID value
found in the 1st form into the 2nd form when it opens. how can you do
this?

cheers
Nov 13 '05 #1
3 1458
Andrew wrote:
Hi,

I have a form that shows a job (computer maintainence system) i have a
button that opens another form that allows the user to log a call to
the manufacturer from the log form. I need access to copy the ID value
found in the 1st form into the 2nd form when it opens. how can you do
this?

cheers


If the second form is always opened from the first just set the DefaultValue
property of the ID control to...

=Forms!NameOfFirstForm!ID

If not then you can use...

DoCmd.OpenForm "SecondFormName"
Forms!SecondFormName!ID = Me.ID
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
This is usually done by "linking" the forms. In the code that opens Form2,
add the link criteria, like:

Dim DocName As String
Dim LinkCriteria As String

DocName = "mySecondForm"
LinkCriteria = "[myID] = Forms![myFirstForm]![myID]"
DoCmd.OpenForm DocName, , , LinkCriteria
If you use the toolbox wizard to create your command button, it will walk
you through the steps.
-Ed

"Andrew" <mc******@hotmail.com> wrote in message
news:5f**************************@posting.google.c om...
Hi,

I have a form that shows a job (computer maintainence system) i have a
button that opens another form that allows the user to log a call to
the manufacturer from the log form. I need access to copy the ID value
found in the 1st form into the 2nd form when it opens. how can you do
this?

cheers

Nov 13 '05 #3
Ed Robichaud wrote:
This is usually done by "linking" the forms. In the code that opens
Form2, add the link criteria, like:

Dim DocName As String
Dim LinkCriteria As String

DocName = "mySecondForm"
LinkCriteria = "[myID] = Forms![myFirstForm]![myID]"
DoCmd.OpenForm DocName, , , LinkCriteria
If you use the toolbox wizard to create your command button, it will
walk you through the steps.
-Ed


That will open the second form filtered to show existing records with the
matching key field from the first form, but it will not cause any NEW
records created in the second form to inherit that key value.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4

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

Similar topics

5
by: Thomas Lotze | last post by:
Hi, another question: What's the most efficient way of copying data between two file-like objects? f1.write(f2.read()) doesn't seem to me as efficient as it might be, as a string containing...
13
by: franky.backeljauw | last post by:
Hello, following my question on "std::copy versus pointer copy versus member copy", I had some doubts on the function memcpy, as was used by tom_usenet in his reply. - Is this a c++ standard...
21
by: Matteo Settenvini | last post by:
Ok, I'm quite a newbie, so this question may appear silly. I'm using g++ 3.3.x. I had been taught that an array isn't a lot different from a pointer (in fact you can use the pointer arithmetics to...
3
by: 21novembre | last post by:
Hi all, I made a question several days before to describe my strange trouble of mysqldump. But I still can't figour it out. Well, I just want to ask another question whether I could just backup...
5
by: Roy Hills | last post by:
When I'm reading from or writing to a network socket, I want to use a struct to represent the structured data, but must use an unsigned char buffer for the call to sendto() or recvfrom(). I have...
5
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute...
3
by: John | last post by:
Hi all, My application updates a sql server 2005 express database prior to copying it with the result being the "in use by another process" and I cannot copy it as a result. I've posted the code...
5
by: ozzii | last post by:
Hi I am using the following code to copy data from one database table into another database table: SELECT * INTO Products From exportdb.mdb.exporttable However the query simply deletes...
18
by: mike3 | last post by:
Hi. I have an interesting problem. The C program presented below takes around 12 seconds to copy 128 MB of data on my machine. Yet I know the machine can go faster since a copying done at a...
10
by: jacc14 | last post by:
Hi I am sure there is an easy way to do this but I have exhausted all avenues. I have some label data in a table which I want to copy to an identical table. However the first label I may only...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.