Search results

  1. C

    VBA SQL Update string to update table using Now Function

    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
  2. C

    VBA SQL Update string to update table using Now Function

    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...
  3. C

    VBA SQL Update string to update table using Now Function

    UPDATE qs = "UPDATE [Holidays] SET Cancelled_By = '" & Me.User_iD & "', Date_Cancelled = #" & Now() & "#, Agreed_Or_Declined = '" & "Yes" & "' WHERE Employee_Id = '" & Me.SearchRef & "'AND Holiday_Type = '" & Me.Holiday_Type & "'AND Date_Of_Holiday = #" & Me.Date_Of_Holiday & "#;" doest...
  4. C

    VBA SQL Update string to update table using Now Function

    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...
  5. C

    VBA SQL Update string to update table using Now Function

    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...
  6. C

    VBA to subtract form field time value from another form field time value

    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 :)
  7. C

    VBA to subtract form field time value from another form field time value

    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...
  8. C

    VBA to subtract form field time value from another form field time value

    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
  9. C

    VBA to subtract form field time value from another form field time value

    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...
  10. C

    VBA to subtract form field time value from another form field time value

    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...
  11. C

    VBA to subtract form field time value from another form field time value

    yes. ideally i do need it as the number of hours between the 2 times
  12. C

    VBA to subtract form field time value from another form field time value

    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...
  13. C

    How to export table data based on criteria to a new excel workbook wothout saving it

    Thanks static. Looks pretty straight forward from your code so will test it today. Thanks
  14. C

    How to export table data based on criteria to a new excel workbook wothout saving it

    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...
Back
Top Bottom