Trying to get my head around this VBA - This code currently works - but i need to introduce a new charge in my table starting from 01-07-2024 - So i need to change this code to look for the StartDate and The EndDate.
Initial Code
I have tried
but get a error (Below)
The underlying table looks like this.
Error message - i think this is due to the end date being blank - but not 100% sure.
Any help appreciated.
Initial Code
Code:
Me.tbRate = Nz(DLookup("Unit_Cost", "TblQCPreRetailSuppliers", "Supp_Code='" & Forms!FrmPreRetailJobs!CboxSupplier & "' AND Forms!FrmPreRetailcharges.tbChargeDate >StartDate"), "")
I have tried
Code:
Me.tbRate = Nz(DLookup("Unit_Cost", "TblQCPreRetailSuppliers", "Supp_Code='" & Forms!FrmPreRetailJobs!CboxSupplier & "' AND Forms!FrmPreRetailcharges.tbChargeDate BETWEEN StartDate EndDate"), "")
The underlying table looks like this.
Error message - i think this is due to the end date being blank - but not 100% sure.
Any help appreciated.