Recent content by boycie

  1. B

    Access date information to SQL Server

    Hi, just to let you know I resolved the issue very simply by assigning getdate() as default in the datetime field thanks again for help
  2. B

    Access date information to SQL Server

    Paul,thanks very much your help. I will keep trying different syntax and keep you posted to how I get on. also thanks to mdlueck
  3. B

    Access date information to SQL Server

    if I take away the # and use following string,; sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('Edinburgh','Ticket','Ben Bloggs', '2012-10-17' )" I get this entry in the table; 2012-10-17 00:00:00.000
  4. B

    Access date information to SQL Server

    also tried putting an actual date in instead of a variable; sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('Edinburgh','Ticket','Ben Bloggs', #2012-10-17# )" error is still; incorrect synatx near '#'
  5. B

    Access date information to SQL Server

    incorrect near syntax '#'.
  6. B

    Access date information to SQL Server

    the field is datetime. My original code was inserting; 1900-01-01 00:00:00.000 in the SQL date field
  7. B

    Access date information to SQL Server

    Paul, I get; incorrect syntax near '14'. The debug print is; Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('Edinburgh','Ticket','Ben Bloggs, #2012-10-17 14:29:00# ) thanks Ian
  8. B

    Access date information to SQL Server

    sorry, post should have said; sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('" & cmbFranchise & "','" & cmbType & "','" & cmbUser & "', #" & Format(dteEntry, "yyyy-mm-dd") & TimeValue(Now) & "# )" error is incorrect syntax near ':'
  9. B

    Access date information to SQL Server

    Paul, thanks for your reply and it certainly makes sense what you say. I tried your code but got an error. I then realised there is probably a ) missing after format of date and so amended as follows; sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('" &...
  10. B

    Access date information to SQL Server

    Hi, I have an Access form that saves some simple data to a SQL Server table. Everything except the date field data is saved. I get the following: 1900-01-01 00:00:00.000 in the SQL date field. Here is my code; Dim dteEntry As Date dteEntry = Date sql = "Insert Into tblFranchiseDiary...
  11. B

    Show last value in combo box

    They both work. Thanks very much to you both
  12. B

    Show last value in combo box

    Hi, By default, when a form opens, for a combo box, I want to show the last value in the list ie. the max of id field. How can I do this? The reason: There are values being entered in a form but then someone else uses that data and it would be good to load the last value rather than searching...
  13. B

    Code for opening report (DoCmd)

    Fixed: this is the amended code I have finally figured out DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='" & strCode & "'"
  14. B

    Code for opening report (DoCmd)

    Hi, I am trying to open a report based on a combo box value but cannot get it to work. The following code works; DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='SS'" or DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='VM'" but when I take the value from the...
  15. B

    Access 2010 Runtime DoCmd Issue

    Thanks Bob, look forward to trying that in work tomorrow. I did notice an "...enable content..." error when opening it so hopefully this will fix it.
Top Bottom