Bck of Records in SubForm

A

an

Hello!

I have a Form (T_Form) with SubForm (T_SubForm).
In Form I have a command button to send present record to
T_Bck and delete it.
Now, I would like to send "SubRecords" (T_SubForm) to
T_Bck too, with same command button, but I don't know if
is possible.
Thanks in advance.
an
 
K

Kelvin

Yes this can be done, but why would you backup both tables into the same
table. Are the data types of the 2 tables the same that you can even do
this or do you mean you want to send both data unnormalized into T_Bck?
I.E.

T_Form contains ID: 1, Name:Bob
T_SubForm contains ID:1, sID:1, Child:Billy, ID:1, sID:2, Child:Sue


T_Bck will become
ID:1, Name:Bob, sID:1, Child:Billy
ID:1, Name:Bob, sID:2, Child:Sue

If this is the case, just create an append query to generate the data above
and add to T_Back. Then use 2 delete queries to remove the data from each
underlying table. If you have referential integrity set, just deleting from
the table for T_Form will also delete from the table for T_SubForm.

Kelvin
 
A

an

Thanks Kelvin for your replay and explanation.

The situation is more or less...
I have:
T_HeadHouse (to Form) with IdHH with primary Key.
T_FamilyAggregate (to SubForm) relation connected through
the field IdHH without primary key.
One to Many in relationships.

For "self-seeking" I would like: with only one action in
command boutton, two tasks. To append data to T_Bck and
delete same records. Later, in same Table we have all
records to read, chronologically.
Perhaps arduous to me...

Many thanks.
an
 
K

Kelvin

Just by your description of the tasks, it can't be done with just one
action. At a minimum, there will be 2 actions, 1 to copy the data, and the
2nd to delete the data. Access doesn't have a move command. Here are some
steps using sime queries. You can also do this using recordsets, but this
might be easier to understand.

Append Query
Insert Into T_Bck
Select T_HeadHouse.*
From T_HeadHouse
Where (IdHH = Forms![NameOfForm]![IdField])

Delete Query
Delete T_HeadHouse.*
From T_HeadHouse
Where (T_HeadHouse.IdHH = Forms![NameOfForm]![IdField])

You can then do the same to the subform data. I don't understand your
statement about reading the data chronologically. If you can expand on
this.

Kelvin
 
A

an

Sorry for my delay (09H00)

Chronologically:
If we put data default value = Now(), in T_Bck, when we
later read records, all in same table, is possible to sort
it, or order it between dates.

+1 Thanks.
an

-----Original Message-----
Just by your description of the tasks, it can't be done with just one
action. At a minimum, there will be 2 actions, 1 to copy the data, and the
2nd to delete the data. Access doesn't have a move command. Here are some
steps using sime queries. You can also do this using recordsets, but this
might be easier to understand.

Append Query
Insert Into T_Bck
Select T_HeadHouse.*
From T_HeadHouse
Where (IdHH = Forms![NameOfForm]![IdField])

Delete Query
Delete T_HeadHouse.*
From T_HeadHouse
Where (T_HeadHouse.IdHH = Forms![NameOfForm]![IdField])

You can then do the same to the subform data. I don't understand your
statement about reading the data chronologically. If you can expand on
this.

Kelvin

Thanks Kelvin for your replay and explanation.

The situation is more or less...
I have:
T_HeadHouse (to Form) with IdHH with primary Key.
T_FamilyAggregate (to SubForm) relation connected through
the field IdHH without primary key.
One to Many in relationships.

For "self-seeking" I would like: with only one action in
command boutton, two tasks. To append data to T_Bck and
delete same records. Later, in same Table we have all
records to read, chronologically.
Perhaps arduous to me...

Many thanks.
an
that
you can even do sID:2,
Child:Sue set,
just deleting from for
T_SubForm. record
to


.
 
K

Kelvin

If you put a time into your table you can use this later to sort. However,
when running the query the same date and time will be put on all records
because all the records are written in one time. Using now() in a query
will set the time at the start of the query and this time will be entered
into all records. The only way to set different times would be to do this
using VBA which can write one record at a time and actually provide a
chronological order. Since your button is only backing up one record this
will not cause problems, but keep this in mind if you decide to try backing
up multiple records at the same time.

Kelvin

an said:
Sorry for my delay (09H00)

Chronologically:
If we put data default value = Now(), in T_Bck, when we
later read records, all in same table, is possible to sort
it, or order it between dates.

+1 Thanks.
an

-----Original Message-----
Just by your description of the tasks, it can't be done with just one
action. At a minimum, there will be 2 actions, 1 to copy the data, and the
2nd to delete the data. Access doesn't have a move command. Here are some
steps using sime queries. You can also do this using recordsets, but this
might be easier to understand.

Append Query
Insert Into T_Bck
Select T_HeadHouse.*
From T_HeadHouse
Where (IdHH = Forms![NameOfForm]![IdField])

Delete Query
Delete T_HeadHouse.*
From T_HeadHouse
Where (T_HeadHouse.IdHH = Forms![NameOfForm]![IdField])

You can then do the same to the subform data. I don't understand your
statement about reading the data chronologically. If you can expand on
this.

Kelvin

Thanks Kelvin for your replay and explanation.

The situation is more or less...
I have:
T_HeadHouse (to Form) with IdHH with primary Key.
T_FamilyAggregate (to SubForm) relation connected through
the field IdHH without primary key.
One to Many in relationships.

For "self-seeking" I would like: with only one action in
command boutton, two tasks. To append data to T_Bck and
delete same records. Later, in same Table we have all
records to read, chronologically.
Perhaps arduous to me...

Many thanks.
an

-----Original Message-----
Yes this can be done, but why would you backup both
tables into the same
table. Are the data types of the 2 tables the same that
you can even do
this or do you mean you want to send both data
unnormalized into T_Bck?
I.E.

T_Form contains ID: 1, Name:Bob
T_SubForm contains ID:1, sID:1, Child:Billy, ID:1, sID:2,
Child:Sue


T_Bck will become
ID:1, Name:Bob, sID:1, Child:Billy
ID:1, Name:Bob, sID:2, Child:Sue

If this is the case, just create an append query to
generate the data above
and add to T_Back. Then use 2 delete queries to remove
the data from each
underlying table. If you have referential integrity set,
just deleting from
the table for T_Form will also delete from the table for
T_SubForm.

Kelvin

message
Hello!

I have a Form (T_Form) with SubForm (T_SubForm).
In Form I have a command button to send present record
to
T_Bck and delete it.
Now, I would like to send "SubRecords" (T_SubForm) to
T_Bck too, with same command button, but I don't know if
is possible.
Thanks in advance.
an



.


.
 
A

an

Ok Kelvin.

Well-disposed.
Many thanks for your qualify opinion.

an
-----Original Message-----
If you put a time into your table you can use this later to sort. However,
when running the query the same date and time will be put on all records
because all the records are written in one time. Using now() in a query
will set the time at the start of the query and this time will be entered
into all records. The only way to set different times would be to do this
using VBA which can write one record at a time and actually provide a
chronological order. Since your button is only backing up one record this
will not cause problems, but keep this in mind if you decide to try backing
up multiple records at the same time.

Kelvin

Sorry for my delay (09H00)

Chronologically:
If we put data default value = Now(), in T_Bck, when we
later read records, all in same table, is possible to sort
it, or order it between dates.

+1 Thanks.
an

-----Original Message-----
Just by your description of the tasks, it can't be done with just one
action. At a minimum, there will be 2 actions, 1 to
copy
the data, and the
2nd to delete the data. Access doesn't have a move command. Here are some
steps using sime queries. You can also do this using recordsets, but this
might be easier to understand.

Append Query
Insert Into T_Bck
Select T_HeadHouse.*
From T_HeadHouse
Where (IdHH = Forms![NameOfForm]![IdField])

Delete Query
Delete T_HeadHouse.*
From T_HeadHouse
Where (T_HeadHouse.IdHH = Forms![NameOfForm]![IdField])

You can then do the same to the subform data. I don't understand your
statement about reading the data chronologically. If
you
can expand on
this.

Kelvin

Thanks Kelvin for your replay and explanation.

The situation is more or less...
I have:
T_HeadHouse (to Form) with IdHH with primary Key.
T_FamilyAggregate (to SubForm) relation connected through
the field IdHH without primary key.
One to Many in relationships.

For "self-seeking" I would like: with only one action in
command boutton, two tasks. To append data to T_Bck and
delete same records. Later, in same Table we have all
records to read, chronologically.
Perhaps arduous to me...

Many thanks.
an

-----Original Message-----
Yes this can be done, but why would you backup both
tables into the same
table. Are the data types of the 2 tables the same that
you can even do
this or do you mean you want to send both data
unnormalized into T_Bck?
I.E.

T_Form contains ID: 1, Name:Bob
T_SubForm contains ID:1, sID:1, Child:Billy, ID:1, sID:2,
Child:Sue


T_Bck will become
ID:1, Name:Bob, sID:1, Child:Billy
ID:1, Name:Bob, sID:2, Child:Sue

If this is the case, just create an append query to
generate the data above
and add to T_Back. Then use 2 delete queries to remove
the data from each
underlying table. If you have referential integrity set,
just deleting from
the table for T_Form will also delete from the table for
T_SubForm.

Kelvin

message
Hello!

I have a Form (T_Form) with SubForm (T_SubForm).
In Form I have a command button to send present record
to
T_Bck and delete it.
Now, I would like to send "SubRecords" (T_SubForm) to
T_Bck too, with same command button, but I don't know if
is possible.
Thanks in advance.
an



.



.


.
 
A

an

Ok, Kelvin

Well-disposed.
Many thanks for your qualify opinion.
an
-----Original Message-----
If you put a time into your table you can use this later to sort. However,
when running the query the same date and time will be put on all records
because all the records are written in one time. Using now() in a query
will set the time at the start of the query and this time will be entered
into all records. The only way to set different times would be to do this
using VBA which can write one record at a time and actually provide a
chronological order. Since your button is only backing up one record this
will not cause problems, but keep this in mind if you decide to try backing
up multiple records at the same time.

Kelvin

Sorry for my delay (09H00)

Chronologically:
If we put data default value = Now(), in T_Bck, when we
later read records, all in same table, is possible to sort
it, or order it between dates.

+1 Thanks.
an

-----Original Message-----
Just by your description of the tasks, it can't be done with just one
action. At a minimum, there will be 2 actions, 1 to
copy
the data, and the
2nd to delete the data. Access doesn't have a move command. Here are some
steps using sime queries. You can also do this using recordsets, but this
might be easier to understand.

Append Query
Insert Into T_Bck
Select T_HeadHouse.*
From T_HeadHouse
Where (IdHH = Forms![NameOfForm]![IdField])

Delete Query
Delete T_HeadHouse.*
From T_HeadHouse
Where (T_HeadHouse.IdHH = Forms![NameOfForm]![IdField])

You can then do the same to the subform data. I don't understand your
statement about reading the data chronologically. If
you
can expand on
this.

Kelvin

Thanks Kelvin for your replay and explanation.

The situation is more or less...
I have:
T_HeadHouse (to Form) with IdHH with primary Key.
T_FamilyAggregate (to SubForm) relation connected through
the field IdHH without primary key.
One to Many in relationships.

For "self-seeking" I would like: with only one action in
command boutton, two tasks. To append data to T_Bck and
delete same records. Later, in same Table we have all
records to read, chronologically.
Perhaps arduous to me...

Many thanks.
an

-----Original Message-----
Yes this can be done, but why would you backup both
tables into the same
table. Are the data types of the 2 tables the same that
you can even do
this or do you mean you want to send both data
unnormalized into T_Bck?
I.E.

T_Form contains ID: 1, Name:Bob
T_SubForm contains ID:1, sID:1, Child:Billy, ID:1, sID:2,
Child:Sue


T_Bck will become
ID:1, Name:Bob, sID:1, Child:Billy
ID:1, Name:Bob, sID:2, Child:Sue

If this is the case, just create an append query to
generate the data above
and add to T_Back. Then use 2 delete queries to remove
the data from each
underlying table. If you have referential integrity set,
just deleting from
the table for T_Form will also delete from the table for
T_SubForm.

Kelvin

message
Hello!

I have a Form (T_Form) with SubForm (T_SubForm).
In Form I have a command button to send present record
to
T_Bck and delete it.
Now, I would like to send "SubRecords" (T_SubForm) to
T_Bck too, with same command button, but I don't know if
is possible.
Thanks in advance.
an



.



.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top