Ok, I am trying to prevent a payment being applied twice and I am trying to create a message box but I seem to be putting the code in wrong or something. Plz help
Ok, I am trying to prevent a payment being applied twice and I am trying to create a message box but I seem to be putting the code in wrong or something. Plz help
Are you getting an error? Is the highlighted text a function on this form?
yea it just says it needs to debug. i think i need to relate it back to the payments table some how.
It should be giving an error message that at least hints at the problem. Can you post the db?
Sure. I created a floating table that would have the paymentId and the payment amount and then post that there...so then it would recognize the payment being present. I hope that makes sense. =)
Your error is coming from the function IsPaymentAlreadyApplied. The SQL statement is bad, should be:
You didn't have a line continuation on the second line.Code:Set resultSet = CurrentDb.OpenRecordset("SELECT 1 " & _ "FROM FloatingTable " & _ "WHERE FloatingTable.PagoID = " & CStr(paymentId) & ";")
yea I just figured that out lol . but now nothing is happening...if you keep clicking the payment keeps reaccuring and the message box isn't popping up
FloatingTable is empty, and offhand I don't see any code that would add a record to it, so that function will always return false, and so you'll never see the message box. Unless I've missed something.
Ah I see what I'm doing wrong. Just needed someone else to look at it. Thanks a bunch!!!!