Search results

  1. B

    DateAdd function not working with field name as interval value

    I'm trying to add a DATEADD function to a field in a query. It works perfectly when using the stand access arguments for the interval (m, ww, yyyy etc) but when I try to use the field in a table as the interval value I get the error: ADO error 'dbo.evtqvwEventsCartesian.PeriodTypeID' not a...
  2. B

    Syntax error near ')'

    This method works in previous areas of the code though so I can't work out why this is any different, for example: Set rstUpdate = GetRecordsetFromSQL("INSERT INTO outtblPeople (perType, perStatus, perSurname, perFirstName, perTitle, perGender, perDateAdded, perSource, perBatchNum, perOldID)...
  3. B

    Syntax error near ')'

    The function is defined here: ' get a recordset object based on a query Public Function GetRecordsetFromSQL(strSQL As String, CursorType As ADODB.CursorTypeEnum, LockType As ADODB.LockTypeEnum) As ADODB.Recordset On Error GoTo Errorhandler 'AddErrorHandlerComment "GetRecordsetFromSQL(" &...
  4. B

    Syntax error near ')'

    I'm afraid I'm not sure which ) it's referring to - is there an easy way to find that out? Sorry not to be more informative but this was written for us sometime ago and I'm not that familiar with VBA yet.
  5. B

    Syntax error near ')'

    I'm receiving the above error when running this code, can anyone tell me why it's not working? Set rstBook = GetRecordsetFromSQL("INSERT INTO jmr101.evttblPlacement ( perID, evtID, evtRoleAtEvent, evtNumPlaces, pmtDateAdded, pupYearGroup ) " & _ " VALUES (" &...
  6. B

    Requested operation requires an ole db session object which is not supported by the c

    Hi, I'm trying to repair part of a database which was set up some time ago. When we moved on sql server 2005 the code below started throwing up this error: Runtime Error '3709' Requested operation requires an ole db session object which is not supported by the current provider. It's on the...
  7. B

    autofill field on linked form

    I have a form which includes details about events. There is a unique field: evtID. A button on the form opens a new form where users can view and add/edit evaluations from attendees at the event. At the moment the two forms are linked so that when you press the button to open the evaluation...
  8. B

    INSERT function failing

    :) Thanks - that seems to have got over that part but it is stuck at the next line: "," & intBatchNum & ",rstImportThese![ID]) ", I can't work out what needs to go around the rstImportThese string - sorry I'm really not very good at this yet!
  9. B

    INSERT function failing

    I've been left with a database designed by someone else and an import feature where data is imported from excel then checked for duplicates before being inserted into outtblPeople, is not working. I get the following error when the insert is trying to take place. The name "Sname" not...
  10. B

    Can't delete records from Access 2007 tables

    I'm using XP. It seems I can delete records from some tables but not others.
  11. B

    Can't delete records from Access 2007 tables

    I recently converted from Access 2003 to 2007 and now I'm unable to delete records in any of the table. Can anyone suggest why this is? Thanks, Lucy
  12. B

    Invalid object error

    Hi, I have a form for adding room bookings to event records. When I click to add the booking I get the following two messages: Error in GetRecordsetFromSQL Funtion: Number: -2147217865 Description: Invalid Object Name evttblBooking Followed by: Error in VB on evtFrmAddHosp Form: Error...
Top Bottom