SOLVED
changed
"' AND Date_Of_Holiday =#" & format(Me.Date_Of_Holiday,","mm/dd/yyyy") & "#;"
to
"' AND Date_Of_Holiday = #" & Format(Me.Date_Of_Holiday, "mm/dd/yyyy") & "#;"
and it works perfectly :)
Thanks again CJ
sorry im in and out of meetings and this network connection is shocking so missed CJ's initial post Post.
Yes CJ EmployeeID and holiday type are both text and that explains it a lot easier for me.
followed it through and i now get an expectec list seperator or ) error on...
Hi John,
thanks for the reply. I've dont realy want to use a query to do it but used your suggestion and did an update query first then used teh code form that.
brings me to the issue of formatting.........the update query doesnt give the syntax required to ensure it udpates with an sql...
hi,
Im using a SQL string to update several columns within my table, one of whcih needs to be now() but i cant get it working.
the sql string is:
qs = "UPDATE [Holidays] SET Cancelled_By = '" & Me.User_iD & "', Date_Cancelled = " & Now & ",
which throws the error:
Runtime Error 3075
syntax...
Fixed :)
used
rs![Hours_Used] = DateDiff("n", [Start_Time], [End_Time]) / 60
in the vba when saving teh record instead and works like a dream.
thnaks both for your help :)
How i didnt think of DateDiff i dont know but still shows as 00:00 instead of 8
so as suggested i looked at help and basically copied your example of
=DateDiff("n",[Start_Time],[End_Time])/60
and ive tried it in both the control source and default value of the field properties and no...
that makes sense. so added the aditional field to teh form with the solution you provided as the control source of that field but the value shows as 00:00 and not the 8 hours i need?
thanks again for the quick reply on this
ok so that kind of works but it stores the Hours_Used in the table in date format so when the "end_time" is 16:00 and the "start_time" is 08:00 it updates the "hours_Used" as 7/01/1900 instead of 8 which is the actual difference.
i tried using teh format function which does format it to HH:MM...
thanks for the quick responses on this.
its actually a user required field on a form so is manually entered by the user.
so tried your solution and get run time error 13 type mismatch
code i used is:
rs![Hours_Used] = (Me.End_Time.Value - Me.Start_Time.Value) * 24
Table field is...
Hi all, Fairly new to Access VBA and i cant for the life of me figure this out or find anything through searches on google/this site that cover my specific problem.
I have a form that when the save button is clicked adds a new line to a table based on the fields completed within the form...
Hi. I need export records form a table to excel. Everything ive come accross so far requires the excel file to be saved as part of the code and the docmd.transferspreadsheet method seems to be the most common way to export to excel but i dont want the excel file saved anywhere. Just need it as...