Originally Posted by david.paton
The error was in this bit of code you put in my db but I can't debug it as I don't understand it.
What error message are you receiving? If we don't know what error you have and on what line, we can't help troubleshooting.
Public Function fncUpdateCarersAvailability()
This means it can be seen anywhere in your application
' make carers available when the CarersDateAvailable has lapsed
Turns off warning messages, such as not being able to find a matching record.
"Update tblCarers Set CarersAvailable = -1 Where " & _
"CarersAvailable = 0 And " & _
"Nz(CarersDateAvailable, 0) <> 0 And " & _
"CarersDateAvailable >= Date();"
This is the bit that actually does something.
It UPDATES your Carers tables setting the available checkbox to true when the check box is false AND the date available is not null or 0 AND the dateAvailable is greater than today. This affects ALL records.
Turns warnings back on
Ends out the function, but I do hope that was rather obvious...
Over view is this resets availability every time the application is opened based on your data.