Updated selected records in a list box

  • Thread starter Thread starter Diane
  • Start date Start date
D

Diane

I am putting together a simple bill-tracking program and have run into
a stumbling block.

Background:
*tblBills and tblChecks in a many-to-one relationship based on
CheckID.

*A data-entry form (based on tblChecks) with an unbound list box which
shows all rows of tblBills in which CheckID is null.

*A button which creates a new record in tblChecks by copying the total
of the selected bill amounts in the list box to the tblCheck field
called Amount.

How do I:
1. Save the new tblChecks record so that I can link to it?
2. Go back into my list box and paste the newly-saved CheckID into
each selected record in tblBills?

Thanks!
 
I think you should do it using a subform in the place of the list box.
You can then create the new CheckID in the main form and then apply the
payment to the selected Bills in the subform, which will show the
outstanding bill IDs and checkboxes "Paid" in the continuous format.

Pavel
 
How do I "apply the payment to the selected Bills in the subform" ...
for that matter, how do I select bills in the subform? I'm not clear
on how this would work. Can you elaborate? Thanks!
 
Make your main form have at least the fields CustomerID (this is a must
- you know who sent the check) and CheckAmount.
Make your subform to have (at least) CustomerID, BillDescription,
BillAmount, isPaid (a Yes/No field).
Link the main for with the subform on CustomerID.
Make the subform appear as Continuous form, so that text box
BillDescription, text box BillAmount and check box isPaid appear next
to each other on one row.
Create a text field that sums BillAmount for all records on subform
where isPaid = True.
When you create a New record in Main form, you will enter Customer ID
and Check Amount. Refresh the subform to see unpaid bills for the
CustomerID entered.
Check the isPaid boxes for those bills you want to apply the check to.
Add code to the Current event of the subform to verify that the sum of
BillAmount in the text box you created above (of all bills you applied
the check to) does not exceed the check amount on the main form.
Don't refresh the subform again until you are finished to avoid hiding
the bills you just applied payments to.

Pavel
 
Back
Top