I need some help relating to updating a date field in a table.
This field is updated by below code:
The date field is updated in mm-dd-yyyy format whereas our system dates are in dd-mm-yyyy format.
In this forum and on google, I found that VBA's default date format is mm-dd-yyyy, OK, that's fine.
But, then how to immune application from these different date formats? I use datediff on a form to get the difference of time between date field of table and now(). That comes totally wrong because date field of table is wrong as per our system calender setting.
Please advise.
This field is updated by below code:
CurrentDb.Execute "INSERT INTO tblTransaction (TransactionPK, bottleFK, Loadingtime,rollingMachineFK,loadedby) values (" & TxPK & "," & Me.lstLoaded.Column(2) & ",#" & Now() & "#," & Me.optRollingMachine & ",'" & [CurrentUser] & "')"
The date field is updated in mm-dd-yyyy format whereas our system dates are in dd-mm-yyyy format.
In this forum and on google, I found that VBA's default date format is mm-dd-yyyy, OK, that's fine.
But, then how to immune application from these different date formats? I use datediff on a form to get the difference of time between date field of table and now(). That comes totally wrong because date field of table is wrong as per our system calender setting.
=IIf([Status]="loaded",DateDiff("n",DMax("loadingtime","tblTransaction","[bottlefk] = [Forms]![frmfilter].[BottleID]"),Now()),"NA")
Please advise.