Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling Records in a Subform

Status
Not open for further replies.

Cleis

Technical User
Jun 4, 2000
197
US
Hi Group! "I've been standing too close to a tree to see the forest"

Here is what I’ve got. I’m building an A/R application and I have a form that does not have a Header/Footer. The top half of the form has been designed to show payment header information. The usual stuff is in this area (basically generic things such as Check Number, Check date, Gross amount, and on and on.

Within this form, I have created a subform (bottom half) that is a continuous form. Within this area, I’m looking for a user to allocate a payment across multiple account numbers on individual lines. Thus you can gather the table structure has a payment header table and a payment detail table joined on an index from the header table. The detail table has the index from the header table and an auto number for the detail index.

When this form opens, I’ve used the docmd method to go to a new record in the subform.

When the initial payment is posted say $100, it is recorded with an account number and as -$100 in the detail table and in 1st line within the subform. The goal is to enter enough transactions to get the value to $0 to enable the save button.

Here is my question. How do I prevent the user from deleting the initial record in the detail table while still enabling the new record which has the focus in the subform? In short, I want to disable the fields (subform) from the initial entry and only enable the new records fields?

I hope this makes sense and that I described my problem clearly. Any help would be appreciated.


Regards!

If it helps, here is the SQL behind the main form and the subform

Main Form
SELECT tblReceiptsHeader.ReceiptHeader,” _
& “ tblReceiptsHeader.[Vendor#],” _
& “ tblNetwork.Division,” _
& “ tblReceiptsHeader.Division AS RecordDivision,” _
& “ tblReceiptsHeader.[Check#],” _
& “ tblReceiptsHeader.CheckDate,” _
& “ tblReceiptsHeader.CheckAmount,” _
& “ tblReceiptsHeader.Applied,” _
& “ tblReceiptsHeader.Comments,” _
& “ tblReceiptsHeader.AllocationDate,” _
& “ tblReceiptsHeader.DepositWeek,” _
& “ tblPaymentMethod.PaymentMethod,” _
& “ tblReceiptsHeader.PaymentMethod AS RecordPaymentMethod,” _
& “tblReceiptsHeader.UserID,” _
& “ tblReceiptsHeader.UserDate,” _
& “ tblReceiptsHeader.ModifiedUser,” _
& “ tblReceiptsHeader.ModifiedDate,” _
& “ tblVendor.VendorName,” _
& “ tblVendor.Admin,” _
& “ tblReceiptsHeader.[Detail File],” _
& “ tblReceiptsHeader.DateFileReceived” _
& “FROM tblPaymentMethod INNER JOIN (tblNetwork INNER JOIN (tblVendor” _
& “INNER JOIN tblReceiptsHeader ON tblVendor.[Vend#] =” _
& “ tblReceiptsHeader.[Vendor#]) ON tblNetwork.DivisionIndex =” _
& “tblReceiptsHeader.Division) ON tblPaymentMethod.MethodIndex =” _
& “ tblReceiptsHeader.PaymentMethod;”

SubForm
SELECT tblReceiptsDetail.ReceiptHeader,” _
& “tblReceiptsDetail.ReceiptDetail,” _
& “ tblReceiptsDetail.Year,” _
& “ tblReceiptsDetail.Period,” _
& “ tblReceiptsDetail.Account,” _
& “ tblReceiptsDetail.Amount,” _
& “ tblReceiptsDetail.Comments,” _
& “ tblReceiptsDetail.UserID,” _
& “ tblReceiptsDetail.UserDate,” _
& “ tblReceiptsDetail.ModifiedUser,” _
& “ tblReceiptsDetail.ModifiedDate FROM tblReceiptsDetail;”

 
Hi
Can you set Allow Deletions to No or have I missed your point?
 
sigh.... Remember that bit about standing to close to tree? Yes this works

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top