I have the following code
In this code the field PrePaymentCash is updated.
However it could also be PrePaymentCheque or PrePaymentEFT, or PrePaymentCard!
At the moment I have 4 versions of the same code, with only the field name changing.
I want to use a Select Case statement to determine which field to update and then use that field in the code. This will be much more efficient!
How would I do this?
Code:
DoCmd.RunSQL "INSERT INTO tblInvoicePrepayment (InvoiceId, PrePaymentValue, PrePaymentDate, PrePaymentCash, Driver) VALUES " & _
"(" & Me.InvoiceId & "," & sngInvoiceBalanceOutstanding & "," & Me.InvoiceDate & ", True, True)"
In this code the field PrePaymentCash is updated.
However it could also be PrePaymentCheque or PrePaymentEFT, or PrePaymentCard!
At the moment I have 4 versions of the same code, with only the field name changing.
I want to use a Select Case statement to determine which field to update and then use that field in the code. This will be much more efficient!
How would I do this?