Search results

  1. K

    checking for duplicates

    Hi I have a form where customers are entered. I want to ensure the same customer is not given 2 references so am divising a bit of code to check. I have created a field on the form that strings together the Surname and UPRN. I have then created a qry which does the same and gives a count of...
  2. K

    runtime 438 error

    That new code works perfectly. Thank you!!! The other books contains the raw data that populates compile.xls, I will test to see if they have to be open for the links to work, i kind of assumed that they had to be open, but i may be wrong. Will simplify things if i can leave them closed...
  3. K

    runtime 438 error

    Hi sorry for the confusion, this is the code i have in Access to export the data and kick off the excel process: Private Sub Command22_Click() Excelpath = Environ("programfiles") & "\Microsoft Office\OFFICE14\excel.exe" mypath = Left$(CurrentDb.Name, Len(CurrentDb.Name) -...
  4. K

    runtime 438 error

    Thanks for your reply, when i run that it highlights .Sheets and says compile error: invalid use of property
  5. K

    runtime 438 error

    Hi I have a data export from Access into Excel, 3 spreadsheets are exported, a master sheet (StatCompile) opens that takes data from the exported sheets, and a 'control' spreadsheet (ctlxlsStat) opens and has some code to print x number of copies of the master spreadsheet. I have just...
  6. K

    changing the path of the default folder

    I take your point, have amended the code and put it in and it works great. thanks for that Kev
  7. K

    changing the path of the default folder

    The problem is I dont want to show the dialogue box when the file is opened, i just want the default save location to be set if and when the user choses to save the file created by the MailMerge. I was really hoping i could just put something like oWord.DefaultFilePath = WholePath in the...
  8. K

    changing the path of the default folder

    Hi Yes, thats exactly it, we have a folder called casework, within that there are folders that are A-Z, so the code will look to see the first letter of the client surname, create a path that I want to pass through to word when the mail merge runs, and when they go to save the document...
  9. K

    changing the path of the default folder

    Hi All I have a script that I use to run a mail merge from Access to Word. This is executed from a form with a persons name. this is the code i use: Private Sub Command41_Click() On Error GoTo ErrorHandling DoCmd.SetWarnings False DoCmd.Close acForm, "frmWriteToClient"...
  10. K

    mail mergve vba runtime 4198 error

    Hi That seems to be working fine with the error handling in. Thanks so much for your help! Kev
  11. K

    mail mergve vba runtime 4198 error

    Sorry, that didn't work, still get the error when i run it, but goes through fine if i step through :banghead:
  12. K

    mail mergve vba runtime 4198 error

    That sounds like an option, but i really wouldnt know where to start with that. How would I check if oApp and oWord are set?
  13. K

    Folder name known, how to determine Folder Path?

    Is the folder in the same location relative to you db on each machine? I use this following code to retireve the folder of the DB then i can navigate to an associated folder from there: Dim mypath As String Dim mypath3 As String mypath = Left$(CurrentDb.Name, Len(CurrentDb.Name) -...
  14. K

    mail mergve vba runtime 4198 error

    Sorry to bump this thread, I know I shouldn't but this error is effecting every mailmerge script I have in the database now. I think it is to do with the antique computers we have here. Does anyone have any ideas how I might get around the problem. Thanks Kev
  15. K

    mail mergve vba runtime 4198 error

    oh, and ive just checked, you are spot on it does fail at the line Set oWord = oApp.Documents.Open(FileName:=mypath3) if i just run the code without stepping through. I have tried putting in a DoEvents command in to allow time for word to open, but it hasnt helped :(
  16. K

    mail mergve vba runtime 4198 error

    hi I did that and it works fine when i step through the process. Could it be that the vba is trying to use the o.word before it has had a chance to open? if so how can I resolve this??
  17. K

    Breaking a linked excel table into multiple tables

    or easiest solution is to apply a filter in the excel table, just tried it in excel 2007 and you get the option to filter by year/month on date columns re your last post: maybe link the table to the excel file, create a form with to and from fields, use these fields as the criteria in your...
  18. K

    Breaking a linked excel table into multiple tables

    I would create a pivot table in excel where you can get summary information and drill down to get the fine detail where neccessary. alternatively in access you can create a linked table to the excel file, and then use queries to seperate the data out into months using a between criteria
  19. K

    mail mergve vba runtime 4198 error

    Hi I have vba to perform a mailmerge: Private Sub Command41_Click() DoCmd.SetWarnings False DoCmd.Close acForm, "frmWriteToClient", acSaveYes Dim mypath As String Dim mypath3 As String Dim Wordpath As String Dim sDBPath As String Dim oApp As Word.Application Dim ThisDB As String Dim oWord...
  20. K

    Couple of small count problems in Report

    thats great, DCount is a new function to me, kind of a count/where. Thanks
Back
Top Bottom