Search results

  1. M

    Problem with VBA and Access 2010

    Thanks! You're right, this morning the function didn't work again, probably because Word wasn't running. After making the following changes I got it to work: On Error Resume Next Set objWord = GetObject(, "Word.Application") If Err.Number <> 0 Then 'Word isn't already running Set...
  2. M

    Problem with VBA and Access 2010

    Yes, I already saw where you're getting at. After making the following changes I got it to work! Private Sub MergeQuest(strFileName As String, strQueryName As String, strDBpath As String) 'On Error GoTo ErrHandling Dim blnCreated As Boolean Dim objDoc As Object Dim objWord As Object Const...
  3. M

    Problem with VBA and Access 2010

    It returns: Run-time error ..... (a long number) Automation error Invalid Syntax It highlights: Set objWord = GetObject("Word.Application")
  4. M

    Problem with VBA and Access 2010

    I had to figure out how to comment out the On Error, I added: ErrorHandler: MsgBox "Error #" & Err.Number & " occurred. " & Err.Description, vbOKOnly, "Error" Exit Sub That's what you mean with commenting out the On Error? If so, is returns Error #4198.
  5. M

    Problem with VBA and Access 2010

    I'm afraid I was celebrating too soon. I copypasted the code in a module, and after making the above changes and going through it using F8, it worked. However, when I use the code as a function, and run it from a form by pressing a command button, it again says whoops.
  6. M

    Problem with VBA and Access 2010

    YES!!! That did the trick! Thank you very much JANR and vbaInet! And also Mr. B and spikepl for the helpful comments. 'Dim objDoc As Word.Document 'Dim objWord As Word.Application Dim objDoc As Object Dim objWord As Object Const wdDoNotSaveChanges = 0
  7. M

    Problem with VBA and Access 2010

    That didn't help. I'll try commenting out the lines that start with "On Error".
  8. M

    Problem with VBA and Access 2010

    Sorry, I could've given more detail. It always ends with the messagebox "Whoops", while it used to (in Office 2003) do the mail merge, print it and close Word. I think the error is somewhere below the second "On Error GoTo ErrHandling". I already checked the references, they should be okay...
  9. M

    Problem with VBA and Access 2010

    Hi, After being forced to use Office 2010 (I was using Office 2003) I'm encountering problems with my database. The function below was working fine in Access 2003. However, now I'm forced to switch to Office 2010, and the function isn't working anymore. The function should mailmerge data from...
  10. M

    Problem with VBA and Access 2010

    Hi, After being forced to use Office 2010 (I was using Office 2003) I'm encountering problems with my database. The function below was working fine in Access 2003. However, now I'm forced to switch to Office 2010, and the function isn't working anymore. Can anybody help me? Best regards...
Back
Top Bottom