Private Sub txt_Discount_BeforeUpdate(Cancel As Integer)
Dim stDiscountReason As String
stDiscountReason = InputBox("Please enter the reason for discount", "Reason Required")
Me.txt_Discount_Reason = stDiscountReason
End Sub
I think you are trying to add information using the popup to the same record you have open in the other form. This is not a good thing to do. Why don't you have a field on your main form for Discount Reason (and you can have it hidden) and then you can have the popup come up (but as an UNBOUND form) and then when the user closes it you use the close event of the popup to set the value of the hidden textbox on the main form. That way you aren't adding another record and just updating the current one. And it LOOKS to the user that something else is happening but you are dealing with it so you are only editing the single record.Thanks for that! It worked fine. But now I'm have trouble with the macro info, i think I dont have the right set up because when I look at my Query for the discount reason it adds extra line ID's
Example of query
SaleID LineID Discount Discount Reason Unit Price Extended Price
1 1 15% $99.00 $84.15
2 0% VIP Client $0.00 $0.00
1 3 15% $18.50 $14.80
4 0% VIP Client $0.00 $0.00
My macro is set up as Follows
Msg - Select Discount reason
OpenForm - Discount Reasons (window mode dialog)
Closeform -save=promt
How can I fix it?
your comments greatly appreciated
Forms![Sales]![Sbf_SalesDetails]![discount reason].Value = stDiscountReason