Hello,
I'm having issues updating a record for a diary database. I have the following code which should update the record where the date selected in the form textbox called txtLocalSystemDate and in a column in the table selected from a list on the form called txtDiaryFeed. Its complicated slightly because of my subforms. When I hover over it on VBA it shows the correct column and row to go in to but when I run the code in the form it shows that it will update 0 records.
It works when I replace the ending looking for the textbox date, so if I put in #09/10/2021#, however this in American Date format, where my computer is in UK date format. This example I am looking to update 10th Sept 2021.
This code did work for a time a few weeks ago, however it has stopped working.
Can anyone advise me what they think is wrong with it please?
Many thanks,
Malcolm
I'm having issues updating a record for a diary database. I have the following code which should update the record where the date selected in the form textbox called txtLocalSystemDate and in a column in the table selected from a list on the form called txtDiaryFeed. Its complicated slightly because of my subforms. When I hover over it on VBA it shows the correct column and row to go in to but when I run the code in the form it shows that it will update 0 records.
It works when I replace the ending looking for the textbox date, so if I put in #09/10/2021#, however this in American Date format, where my computer is in UK date format. This example I am looking to update 10th Sept 2021.
Code:
DoCmd.RunSQL "UPDATE tbl_Net_Diary SET " & [Forms]![frmBackground]![subfrmHome]![txtDiaryFeed] & " = [Forms]![frmBackground]![subfrmHome]![txtDiaryEdit] WHERE TheDate = # " & [Forms]![frmBackground]![txtLocalSystemDate] & " #"
This code did work for a time a few weeks ago, however it has stopped working.
Can anyone advise me what they think is wrong with it please?
Many thanks,
Malcolm