So here's my problem...I have a table with 5 fields, - cheque #, cheque date, amountpaid, amountreceived and status. When the user clicks on a command button call it 'cmdUpdate' on the form 'MyForm', I need the system to check the amountpaid and amountreceived fields and if they (the values in the fields)match, the status should be set to 'Cashed'; if the present date is 6 months or more greater than the cheque date, the status should be set to 'Stale' and for all others the status should be set to 'unpresented'. Could you help me with the vb code to run behind the button for this to take place? Presently the code behind the button is; SO I need to add some statements where the blue text is written)
Private Sub cmdAppendCheques_Click()
'turn off warnings
'append validated cheques to master
(This is where the other code should be and should read something like
if tblData.amountpaid = tblData.amountreceived then
tblStatus = "Cashed"
Could you help me out)
'clear the appended cheques
'refresh the screen
'turn on the warnings
You are fabulous! Thank you tonnes. That line of code work good...it really shows!
I have another question pertaining to the first, with respect to stale records, some records contain null cheque date cells and as another check for the stale status, the cheque date field should not be null, could I used an 'And' within that statement you give?
For instance, IIF [cheque date] IsNotNull And DateDiff('m', [cheque date], Now) < 6,'Unpresented','Stale'))"