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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sales Entry Underlying Query update 1

Status
Not open for further replies.

BofRossClan

Technical User
Mar 26, 2002
39
US
I have a sales entry form for a small art business using Access 2003. My sales entry form is set up with "sales" being the whole sale, and "transactions" being a subform with individual transactions. The sales table contains the customer information, subtotal, sales tax, total, tender received. The totals are computed in a separate table and brought into the form using Dlookup.

I'm having an issue with what happens when a transaction is entered, but the person entering does not exit the row. The underlying table with my calculations does not update.

I tried to get past this issue with this stupid little code which forced the last entry to be included in the calculation:
DoCmd.GoToRecord , , acNewRec
DoCmd.GoToRecord , , acLast

However, when I did that, it made a weird thing happen with another part of my code. When the sale is complete, I run this code to make sure the tender received has been entered:

If Me.txtTenderTotal <> Me.Total_Sale Then
Beep
Response = MsgBox("Tender received does not equal Total Sale. Are you sure you want to continue?", vbCritical + vbYesNo)
If Response = vbNo Then
Me.Filter = "SalesID = " & intSALESID
Exit Sub
End If
End If

Selecting "No" should take them back to the form and the sale they were entering. However, the other code now causes this stupid dippy do thing where it hides all the transactions, and the only way to get the records back is to right click on the transaction id on the form and "Filter by Selection".

There must be either another way to update the underlying query, or stop losing my transactions when payment is forgotten to be entered.

Any ideas?

 
What happens if you replace this:
DoCmd.GoToRecord , , acNewRec
DoCmd.GoToRecord , , acLast
with this ?
Me.Dirty = False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top