Re: Recordsetclone mistake
From: Alex (anonymous_at_discussions.microsoft.com)
Date: 06/14/04
- Next message: Kevin3NF: "Re: Link Tables to SQL Server DB - Unique Record Identifier"
- Previous message: Bob: "Distinct Query, on one field with return on multiple fields"
- In reply to: Dirk Goldgar: "Re: Recordsetclone mistake"
- Next in thread: Alex: "Re: Recordsetclone mistake"
- Reply: Alex: "Re: Recordsetclone mistake"
- Reply: Dirk Goldgar: "Re: Recordsetclone mistake"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Jun 2004 13:59:07 -0700
Thanks a lot again, Dirk.
It's easy to get the sum by using a query for these two
tables and get the form by using it. But, my concern is
that in this case I'll loose the opportunity to edit data
in Table1 directly from the form and I'll need to use
recordset with loop to assign edited data to the table. I
was trying to avoid it.
Please, advise if there is any other ways.
Table1 is actually a variable name (there are some tables
with product code' names). A user chooses this product
code from another form then the program assigns it to
strCode and Me.RecordSource = strCode
tblTable1 tblRate
Operation Rate Code
StaffDay Rate
ShiftDay
StaffAFT
ShiftAFT
RateCode
Alex
>-----Original Message-----
>"Alex" <anonymous@discussions.microsoft.com> wrote in
message
>news:1c79901c45249$ebaf9720$a001280a@phx.gbl
>> Thanks a lot, Dirk.
>>
>> As you asked for an explanation, I need to get a total
for
>> txtDol to show it in the textbox1 on a formfoot of a
>> continious form.
>> This continious form is linked with Table1 to be able to
>> edit data there from this form.
>>
>> txtDol on this form = [txtRate]*([txtShiftDay]*
>> [txtStaffDay]+[txtShiftAFT]*[txtStaffAFT]) where
>>
>> txtRate = Control Source = [cboRateCode].Column(1)
>> cboRateCode has Control Source [Rate Code] from Table1
but
>> Row Source is Table2.
>>
>> ii = [txtRate]*([txtShiftDay]*[txtStaffDay]+
[txtShiftAFT]*
>> [txtStaffAFT]) gives a mistake because it cannot
recognize
>> txtRate. It says "Run-time error '2447'. There is an
>> invalid use of the .(dot) or ! operator or invalid
>> parentheses."
>>
>> When I'm using the advised by you the same but with "!"
>> (!txtTextBox]) I'm getting "Error '3265'. Item not found
>> in this collection."
>
>That's because, as you now explain, these text boxes --
at least,
>txtRate -- are not fields in the form's recordset; they
are unbound
>controls on the form. So the form knows about them, but
its recordset
>does not.
>
>I think the best way to go about this is to base the
form, not on
>Table1, but on a query that joins Table1 and Table2
appropriately and
>picks up the necessary fields from Table2. Then you can
just use the
>Sum() function to calculate the total for the text box in
the form's
>footer.
>
>If you will please post the true names and field lists
from the both
>"Table1" and "Table2" -- and any other tables that are
involved -- I may
>be able to give more specific advice.
>
>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com
>
>(please reply to the newsgroup)
>
>
>.
>
- Next message: Kevin3NF: "Re: Link Tables to SQL Server DB - Unique Record Identifier"
- Previous message: Bob: "Distinct Query, on one field with return on multiple fields"
- In reply to: Dirk Goldgar: "Re: Recordsetclone mistake"
- Next in thread: Alex: "Re: Recordsetclone mistake"
- Reply: Alex: "Re: Recordsetclone mistake"
- Reply: Dirk Goldgar: "Re: Recordsetclone mistake"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|