Re: Recordsetclone mistake
From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 06/14/04
- Next message: Michael Miller: "Table (in form) Not Showing New Record Unless Close Form and Re-Op"
- Previous message: Jean-Paul De Winter: "empty recordset"
- In reply to: Alex: "Re: Recordsetclone mistake"
- Next in thread: Alex: "Re: Recordsetclone mistake"
- Reply: Alex: "Re: Recordsetclone mistake"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Jun 2004 16:07:33 -0400
"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: Michael Miller: "Table (in form) Not Showing New Record Unless Close Form and Re-Op"
- Previous message: Jean-Paul De Winter: "empty recordset"
- In reply to: Alex: "Re: Recordsetclone mistake"
- Next in thread: Alex: "Re: Recordsetclone mistake"
- Reply: Alex: "Re: Recordsetclone mistake"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|