Search results

  1. S

    Sending Automated Email

    Looks like I'm trying to do the same thing. Currently the code can populate the email with everything I want and works for 1 record. But instead of looping to another email address in the recordset it just adds the same attachment to the first email. Does someone know what I have done wrong in...
  2. S

    Import data from Word Forms into Access

    That make's sense but now if I close the first table with a .close I get the error: "Object invalid or no longer set" And if I remove the .close then I get: "The document you selected does not contain the required form fields" I cant win... !RCSSubmission = "Yes" .Update .Close End With...
  3. S

    Import data from Word Forms into Access

    What would be the best way to do this? Dlookup? Error is "object required" Any suggestions? Thanks Dim currentkey As Field currentkey = DLookup("key", "legalentityid", LegalEntityID.ApplicantName = doc.FormFields("ApplicantName").Result) With rst1 .AddNew !Key = "currentkey...
  4. S

    Import data from Word Forms into Access

    That works perfectly. Thanks. The problem I have now is that I need to import data from the form into multiple tables. The first table will have a 'key' created automatically for the new record but how would I link the next table to the newly created key? This is where I'm up to. The problem, I...
  5. S

    Import data from Word Forms into Access

    Thanks but it doesn't like your replacement line. "rst = " is an invalid use of property The code has come from: msdn.microsoft.com/en-us/library/office/aa155434(v=office.10).aspx
  6. S

    Import data from Word Forms into Access

    Thanks guys, think I'm nearly there. Current rst doesnt seem as though it's defined. This might be the current issue. (Object variable or With variable not set). How would I fix this part? Private Sub btnImport_Click() Dim appWord As Word.Application Dim doc As Word.Document Dim db As Database...
  7. S

    SQL Where statement from fields

    Thanks and yes the desired out come is: When fields are blank - return all records. When 1 location field has data - limit records to the location. When multiple fields have have - limit records of those with all selected locations. e.g. if the table data is as follows and the form selects...
  8. S

    SQL Where statement from fields

    Ok thanks, The query now seems to be running too slow to load. Do you think this would be due to having the same table 3 times? Is there a better way to design the query
  9. S

    SQL Where statement from fields

    Hi, I'm having trouble with using a where statement linked to fields when the field is empty. I need a way to say if field is null then 'do nothing'/'select all' else use the text from the box. I have a form (ServicesRCSSearch) which has 3 combo boxes (Location1, Location2 and Location3)...
  10. S

    Using Variables in VBA SQL

    I'm trying to add a variables into the below SQL to make up a field but can't work out how to do it. Variable3 needs to be the field made up of text from Variable1 and Variable2. Variable1 and Variable2 come from Combo boxes where Variable1 will be the Table name and Variable2 will be the...
  11. S

    Import data from Word Forms into Access

    I've altered the code a little as suggested but it seems to be getting stuck on the strDocName section. Run-time error 91: Object variable or With block variable not set The document is saved as a .doc document in the correct location. Any suggestions? Sub GetWordData2() Dim appWord As...
  12. S

    Import data from Word Forms into Access

    thanks for your reply. So what would you change it in the following: Sub GetWordData2() Dim appWord As Word.Application Dim doc As Word.Document Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset Dim strDocName As String Dim blnQuitWord As Boolean strDocName = "C:\Contracts\" & _...
  13. S

    Import data from Word Forms into Access

    I'm having the same issue. My thoughts were to: 1. replace the .mdb with .accdb, add a new reference for Microsoft ActiveX Data Objects #.# Library and then change the Microsoft.Jet.OLEDB.4.0; or 2. if using the current database replace cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _...
Back
Top Bottom