Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to copy data within an access form 1

Status
Not open for further replies.

gmarrufo

IS-IT--Management
Apr 16, 2003
26
US
Hello,

The following is my scenario:

I have an access form with a tab control. This tab control contains multiple tabs as is expected. One of the tabs contains text boxes, which are bound to the main query for the form. (Main Table called: module)

Another tab contains just a sub-form, which is bound to a separate table (table name: closing information). The “module” and “closing information” tables are linked by an ID field.

My problem is that I want to save information from the first tab (text boxes) into the sub-form and table associated with it. I know I can fill the text boxes and then with a command button trigger the event and of course I can see the data from the text boxes because is bounded to the main table (module) but I don’t know what to use to perform the update.

Any help would be greatly appreciated.

G
 
First off, WHY are you taking data that is stored in the main table and then storing it again in the subTable ????

This sounds very much like incorrect Normalisation.


However, if you really must -
Do you want to do it :-
1) As soon as data changes in the controls that are bound to the main table ?
2) As soon as the focus record in the subForm changes ?
3) When the main table record is updated ?
4) On command of the user ( a command button )
5) Some other external event

The HOW depends on the WHAT.






G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Hi littlesmudge,

Thanks for your reply. In response that why I have to do that, the owner of this application wants to keep that specific information in an independent table as historical. I explained to him the Normalisation process and so and so but he is a user and wants it this way.

The "what" will be option number 4 (on command of the user).

Again thanks for your reply and help.

G
 
First off Know and Understand that controls like text boxes on a tab are no different to controls on the form itself.

A tab is simply a visual illusion created to allow the developer to stach lots of control one on top of the other and help the user to live through the mess.

THEREFORE
a control txtDemo1
on a form frmEntry1 can be referred to in code as
Forms!frmEntry1!txtDemo1
and that works regardless of which tab ( or no tab at all ) that the control is on.

So,
If you have a subForm control called subfrmClosing
which has in it a text box control called txtFTSE then

Forms!frmEntry1!subfrmClosing.Form!txtFTSE = Forms!frmEntry1!txtDemo1

will cause the value in txtDemo1 to majically appear in the txtFTSE on the subForm.

Now if you run this code from a command button on the frmEntry1 then its all a lot easier because you don't need absolute referencing and you can cut it down to

subfrmClosing.Form!txtFTSE = txtDemo1



Does that give you enough direction to be getting on with ?






G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Yes, You have been extremely helpful

Thanks,

G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top