Data Transfer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a small data base with 1 table. The form has TABS and when a husband
dies I want to be able to transfer the husband's details to the wife's
details and vice versa. I need to copy the husband's details into a set of
temporary variables, set the fields of the other into that one and then copy
the temp variables into the other.
Example of field names: Husband Fname, Husband Date of Birth etc; Wife
Fname, Wife Date of Birth etc.
Can any one help me with the code and where do I write this. Query, Module
or what?
Thanks for any help
 
it's not clear what your table design is, or what you're trying to
accomplish. are husband and wife each listed in a separate record in the
table - as two separate persons, or clients, or policyholders, or...? if the
husband dies, you want to save his name, dob, etc into the wife's record,
overwriting her name, dob, etc?

can you explain what you're trying to do? and, please post details of your
table, as

TableName
FieldName (primary key)
NextFieldName
NextFieldName
etc
etc

hth
 
Thanks Tina for your reply. Sorry about not been clear. The husband and wife
details all are part of the 1 table and I have TABS on the Form to move from
Husband's details to the Wife/Partner details. If the Husband dies I want to
be able to transfer his details into the Wife/Partner section and at the same
time transfer the Wife/Partner details into the Husband section so the
Wife/Partner then becomes the Predominant member. I understand this can be
done by copying the fields into a set of temporary variables using code in a
Module??, Query??

The Table is called "Main Table"
Autonumber(Primary key)
Husband Lname
Husband Fname
Husband DOB
Wife/Partner Lname
Wife/Partner Fname
Wife/Partner DOB

There is only table in this simple data base and no relationships.

Thanks for any further help
 
okay, thanks for the additional info. as i suspected, your table design is
not normalized, in that you're storing data in field names: *husband* last
name, *wife/partner* last name, etc. this looks like a situation where the
table should list each person once (whether primary member or partner), and
"refer to itself" to designate the partner of each member. i've put such a
table together, and have been building a form to test the data entry - using
your design parameters of "I have TABS on the Form to move from Husband's
details to the Wife/Partner details", and including a way to switch the
"primary" designation from the primary member to the partner. i'll post back
within a day or so to tell you if the test was successful.

hth
 
Hi Roger,

Maybe a table design more like this would make life easier:

PersonType - will be Husband or WifePartner
LastName
FirstName
DOB
Predominant Yes/No datatype

HTH Linda
 
this is a pretty simple setup, as far as the table goes. each person is
listed once, whether s/he is a primary member or a primary member's partner;
a foreign key field for the "partner of" data is entered only in the records
where the person is a partner, and "partner of" refers back to the primary
member's primary key value. (it makes more sense when you look at the table,
than it does when explained in print.)

a simple data entry form, with a combo box to enter the "partner of" data
for the "subordinate" person records, would have been easy enough. but what
i built and tested (thoroughly, i hope) is a tabbed form that allows primary
members and partners to be entered as though they were part of one record,
and automatically "swaps" the primary member/partner data when the primary
member is marked as deceased. (i included some additional functionality that
seemed necessary for a data entry form, as well.)

that was a tougher task, too involved to try to explain in an NG post. so i
uploaded the demo database to my website. you can download it and study the
design, if you like, by going to
http://home.att.net/~california.db/downloads.html, scrolling to the bottom
of the page, and clicking the demo.bak link. note that after you download
the file, you must change the .bak extension back to .mdb BEFORE you open
the file in Access. if you have any questions about the design, you're
welcome to email me. you'll find my email address at
http://home.att.net/~california.db/tips.html#aTip10; follow the instructions
in the Example, AND change the number 2 to a number 1.

hth
 
Back
Top