473,394 Members | 2,020 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,394 software developers and data experts.

Copying data from field to field in form automatically ?

Hi everybody - hope you can help out here.

I have a form in a database, which is a columnar form from one of the tables
in the db - there is a sub-form to the form which is a datasheet view of
another table in the db. The LinkChilds property is set to show connected
records from both tables.

What I'd like to do is copy and paste, or use some other method of writing,
the contents of one field in one table in the form, to a field in the table
in the sub-form, preferably with a button on the form which will copy the
data without having to manually copy and paste from field to field.

Is this sort of thing possible ?, and could anybody maybe point me in the
right direction as to how it might be done.

Cheers, and thanks in advance.

Andy

A N D R E W H U T C H I N G S , N E W C A S T L E UK
e-mail: an**@airnorth.demon.co.uk

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
Nov 12 '05 #1
4 6762
DFS
Andy,

Put the main form in design mode, drop a command button on it, and add some
code like this to the button's OnClick property (it will copy from the main
form to the subform):

me.subFormName.Form.Field1Name = me.Field1Name
me.subFormName.Form.Field2Name = me.Field2Name
....

"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
Hi everybody - hope you can help out here.

I have a form in a database, which is a columnar form from one of the tables in the db - there is a sub-form to the form which is a datasheet view of
another table in the db. The LinkChilds property is set to show connected
records from both tables.

What I'd like to do is copy and paste, or use some other method of writing, the contents of one field in one table in the form, to a field in the table in the sub-form, preferably with a button on the form which will copy the
data without having to manually copy and paste from field to field.

Is this sort of thing possible ?, and could anybody maybe point me in the
right direction as to how it might be done.

Cheers, and thanks in advance.

Andy

A N D R E W H U T C H I N G S , N E W C A S T L E UK
e-mail: an**@airnorth.demon.co.uk

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003

Nov 12 '05 #2
Thanks very much for the prompt reply - I have tried it, but I don't think
I'm writing the code correctly.

I'm not sure what 'me' is ..... could you re-write the code with my db names
etc. in their correct place, as per the following names please.

Database name = Civil
Form name = Changes (same name as underlying table)
sub-form name = bbH (same name as underlying table)
Field name in Changes = NAME
Field name in bbH = OWNER

I want the field NAME in Changes to be written to the field OWNER in bbH

Sorry if I'm totally thick, and thanks again

Andy

"DFS" <no******@nospam.com> wrote in message
news:vs************@corp.supernews.com...
Andy,

Put the main form in design mode, drop a command button on it, and add some code like this to the button's OnClick property (it will copy from the main form to the subform):

me.subFormName.Form.Field1Name = me.Field1Name
me.subFormName.Form.Field2Name = me.Field2Name
...

"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
Hi everybody - hope you can help out here.

I have a form in a database, which is a columnar form from one of the

tables
in the db - there is a sub-form to the form which is a datasheet view of
another table in the db. The LinkChilds property is set to show connected records from both tables.

What I'd like to do is copy and paste, or use some other method of

writing,
the contents of one field in one table in the form, to a field in the

table
in the sub-form, preferably with a button on the form which will copy the data without having to manually copy and paste from field to field.

Is this sort of thing possible ?, and could anybody maybe point me in the right direction as to how it might be done.

Cheers, and thanks in advance.

Andy

A N D R E W H U T C H I N G S , N E W C A S T L E UK
e-mail: an**@airnorth.demon.co.uk

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
Nov 12 '05 #3
DFS
"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
Thanks very much for the prompt reply - I have tried it, but I don't think
I'm writing the code correctly.

I'm not sure what 'me' is ..... could you re-write the code with my db names etc. in their correct place, as per the following names please.

Database name = Civil
Form name = Changes (same name as underlying table)
sub-form name = bbH (same name as underlying table)
Field name in Changes = NAME
Field name in bbH = OWNER

I want the field NAME in Changes to be written to the field OWNER in bbH
Andy, for purposes of this particular line of code:

database name = Civil = not important
Form name = Changes = not important
sub-form name = bbH = important
Me = reference to form executing the code = imporant
Field name in Changes = NAME = important
Field name in bbH = OWNER = important
On form "Changes", add a click button and this code to it:

me.bbH.Form.OWNER = me.[NAME]

(note: I put Name in brackets because it's a common property of Access
objects. In general you shouldn't use NAME as a field name).

Sorry if I'm totally thick, and thanks again

Andy

"DFS" <no******@nospam.com> wrote in message
news:vs************@corp.supernews.com...
Andy,

Put the main form in design mode, drop a command button on it, and add

some
code like this to the button's OnClick property (it will copy from the

main
form to the subform):

me.subFormName.Form.Field1Name = me.Field1Name
me.subFormName.Form.Field2Name = me.Field2Name
...

"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
Hi everybody - hope you can help out here.

I have a form in a database, which is a columnar form from one of the

tables
in the db - there is a sub-form to the form which is a datasheet view of another table in the db. The LinkChilds property is set to show connected records from both tables.

What I'd like to do is copy and paste, or use some other method of

writing,
the contents of one field in one table in the form, to a field in the

table
in the sub-form, preferably with a button on the form which will copy the data without having to manually copy and paste from field to field.

Is this sort of thing possible ?, and could anybody maybe point me in the right direction as to how it might be done.

Cheers, and thanks in advance.

Andy

A N D R E W H U T C H I N G S , N E W C A S T L E UK
e-mail: an**@airnorth.demon.co.uk

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003

Nov 12 '05 #4
Thank you again very much for confirming that code.

I have done as you said, but am now getting an error message "Microsoft
Access can't find the macro 'me'." when I click the button to try to execute
the operation. I'm using Access97 btw ...

Thank you very much

Andy
e-mail: an**@airnorth.demon.co.uk
"DFS" <no******@nospam.com> wrote in message
news:vs************@corp.supernews.com...
"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
Thanks very much for the prompt reply - I have tried it, but I don't think
I'm writing the code correctly.

I'm not sure what 'me' is ..... could you re-write the code with my db names
etc. in their correct place, as per the following names please.

Database name = Civil
Form name = Changes (same name as underlying table)
sub-form name = bbH (same name as underlying table)
Field name in Changes = NAME
Field name in bbH = OWNER

I want the field NAME in Changes to be written to the field OWNER in bbH


Andy, for purposes of this particular line of code:

database name = Civil = not important
Form name = Changes = not important
sub-form name = bbH = important
Me = reference to form executing the code = imporant
Field name in Changes = NAME = important
Field name in bbH = OWNER = important
On form "Changes", add a click button and this code to it:

me.bbH.Form.OWNER = me.[NAME]

(note: I put Name in brackets because it's a common property of Access
objects. In general you shouldn't use NAME as a field name).

Sorry if I'm totally thick, and thanks again

Andy

"DFS" <no******@nospam.com> wrote in message
news:vs************@corp.supernews.com...
Andy,

Put the main form in design mode, drop a command button on it, and add

some
code like this to the button's OnClick property (it will copy from the

main
form to the subform):

me.subFormName.Form.Field1Name = me.Field1Name
me.subFormName.Form.Field2Name = me.Field2Name
...

"Andy Hutchings" <an**@airnorth.demon.co.uk> wrote in message
news:bq*******************@news.demon.co.uk...
> Hi everybody - hope you can help out here.
>
> I have a form in a database, which is a columnar form from one of the tables
> in the db - there is a sub-form to the form which is a datasheet view of > another table in the db. The LinkChilds property is set to show

connected
> records from both tables.
>
> What I'd like to do is copy and paste, or use some other method of
writing,
> the contents of one field in one table in the form, to a field in
the table
> in the sub-form, preferably with a button on the form which will

copy the
> data without having to manually copy and paste from field to field.
>
> Is this sort of thing possible ?, and could anybody maybe point me
in the
> right direction as to how it might be done.
>
> Cheers, and thanks in advance.
>
> Andy
>
> A N D R E W H U T C H I N G S , N E W C A S T L E UK
> e-mail: an**@airnorth.demon.co.uk
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
>
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
Nov 12 '05 #5

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

Similar topics

1
by: JC | last post by:
How do I extract data from a form into the main form for processing? For instance, I have several image files in a form called images(images.frm), indexed from 0 to 99, and I want to import these...
6
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo...
3
by: Jain | last post by:
Hi, How can I make it compulsory for data to be entered into a field in a form. Eg it won't allow the user to close the form without filling in a particular field. An error message appears...
1
by: meganrobertson22 | last post by:
hi everybody- what is the best way to add data from one form to another? i have 2 tables: person and contract. here are some of the fields. table: person personid (autonumber and primary...
8
by: daD | last post by:
I'm trying to write a small database that tracks people coming and going from a small campground. I need to have the current guests in the "current" table" and then have the ability to check them...
4
by: nicbowker | last post by:
Dear All, I'm creating a simple purchasing database. The user enters the purchasers name and address. Later on in the same form it asks for the credit card registered address and also the...
13
by: hexagram | last post by:
hi guys can anybody can teach me how to do this scenario Transfering Data of a form to a new form The Scenario is: I have a Delivery Receipt Form (Hardware) with a fields of the following ...
1
by: Headbanger | last post by:
Hello, I would appreciate any help or suggestions. I am not a programmer. I need a large amount of non-personal data from a form to be transfered to a script in a popup. Client-side...
18
by: angi35 | last post by:
I've been puzzling over something, and hopefully someone here can help me figure it out. In Access 2000, I have two forms... let's call them formA and formB. Users enter data first into formA. ...
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
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
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
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.