Sending Data from One subForm to another

B

Bob Vance

If I have 2 subForms on a form
subFormA and subFormB and each field has 2 text boxes , what code do I need
in my control to send tbA and tbAA to subFormB , tbB and tbBB
 
J

John W. Vinson

If I have 2 subForms on a form
subFormA and subFormB and each field has 2 text boxes , what code do I need
in my control to send tbA and tbAA to subFormB , tbB and tbBB

Step back a bit.

Data is not stored in forms nor in subforms, but only in Tables. What are the
Recordsources of these two subforms? Are you trying to (unwisely, probably!)
store the same data redundantly in two different tables? What's the context,
and what are you trying to accomplish by doing this?
 
B

Bob Vance

John W. Vinson said:
Step back a bit.

Data is not stored in forms nor in subforms, but only in Tables. What are
the
Recordsources of these two subforms? Are you trying to (unwisely,
probably!)
store the same data redundantly in two different tables? What's the
context,
and what are you trying to accomplish by doing this?

Thanks John SubFormA has a recordsouce to a query and shows about 5 records
that are true that are used freqently SubFormB has a recordsource to a Table
that is storing the data, SubFoemB can access the same data but it has
hundreds of records to choose from so I am trying to use subFormA to enter
these records as the are always being used,,,,,,,,Regards Bob
 
J

John W. Vinson

Thanks John SubFormA has a recordsouce to a query and shows about 5 records
that are true that are used freqently SubFormB has a recordsource to a Table
that is storing the data, SubFoemB can access the same data but it has
hundreds of records to choose from so I am trying to use subFormA to enter
these records as the are always being used,,,,,,,,Regards Bob

If you have two tables storing the "same kind" of data (identical field
numbers and datatypes), you'll do much better to use just *one* table. If need
be, you can include one more field: UsedFrequently say, a Yes/No field. Check
the checkbox for these five records. You can base one form on a query
selecting records where this is true (the five records) or without a criterion
(all the records).
 
B

Bob Vance

John W. Vinson said:
If you have two tables storing the "same kind" of data (identical field
numbers and datatypes), you'll do much better to use just *one* table. If
need
be, you can include one more field: UsedFrequently say, a Yes/No field.
Check
the checkbox for these five records. You can base one form on a query
selecting records where this is true (the five records) or without a
criterion
(all the records).
Thanks John, Its just the one table tblAddiyionalCharges , how can I get
the the Combobox to show the latest 5 records selected to show at the top
then Alpha order the rest, the record source to the combo box is
SELECT ChargeID, ChargeDescription, ChargeAmount FROM tblAdditionalCharges
ORDER BY ChargeID;

regarsd Bob
 
J

John W. Vinson

Thanks John, Its just the one table tblAddiyionalCharges , how can I get
the the Combobox to show the latest 5 records selected to show at the top
then Alpha order the rest, the record source to the combo box is
SELECT ChargeID, ChargeDescription, ChargeAmount FROM tblAdditionalCharges
ORDER BY ChargeID;

Unless you have some field in tblAdditionalCharges that can be used to
identify "the latest" - an autonumber, a date, *something* - then you can't.
If ChargeID is a sequential autonumber then a rather snarky UNION query could
be made to work... but I'd be totally baffled if I saw a combo box that had
five records in one sort order, and then scores more in a *different* sort
order; and this would ruin the autocomplete feature!

Could you explain your rationale? What does this table mean? How will you be
using the combo box? Why do you want the most recent five at the top?
 
B

Bob Vance

Unless you have some field in tblAdditionalCharges that can be used to
identify "the latest" - an autonumber, a date, *something* - then you
can't.
If ChargeID is a sequential autonumber then a rather snarky UNION query
could
be made to work... but I'd be totally baffled if I saw a combo box that
had
five records in one sort order, and then scores more in a *different* sort
order; and this would ruin the autocomplete feature!

Could you explain your rationale? What does this table mean? How will you
be
using the combo box? Why do you want the most recent five at the top?

John, I do have an AutoNumber field and I create another field if needed
I have about 200 charges in alphabet order but about 5 charges are almost
alwat used , so instead of scrolling down to W for Washing it would be in
the top five....Thanks Bob
 
J

John W. Vinson

John, I do have an AutoNumber field and I create another field if needed
I have about 200 charges in alphabet order but about 5 charges are almost
alwat used , so instead of scrolling down to W for Washing it would be in
the top five....Thanks Bob

ummmm... you DO know that you *don't need to scroll*, right?

If you tab or click into a combo box and type W it will jump to the first
record where the field starts with W. If you type "was" it should jump right
to Washington. This is called "autocomplete" and it's a standard feature of
combo boxes!

That said, you could add the yesno field I suggested and base the combo box on
a query sorting first by this field (the Yes values will sort first) and then
alphabetically.
 
B

Bob Vance

John W. Vinson said:
ummmm... you DO know that you *don't need to scroll*, right?

If you tab or click into a combo box and type W it will jump to the first
record where the field starts with W. If you type "was" it should jump
right
to Washington. This is called "autocomplete" and it's a standard feature
of
combo boxes!

That said, you could add the yesno field I suggested and base the combo
box on
a query sorting first by this field (the Yes values will sort first) and
then
alphabetically.
Thanks John , I actually had thought of doing that using a check box
As for typing W yes that does work but that means using the keyboad, an I
was tying to keep to using the mouse :)
Regards Bob
 

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