Search results

  1. S

    VBA 2007 to 2010 conversion issue

    Thanks Bob, That's helpful. I Dim'ed NewDoc as an object and for some reason had to add a line of code to open the template before setting it as NewDoc. Not really sure why this fixed the issue but it did. The template was still saved in 2007 format so I didn't change the extension to .docx...
  2. S

    VBA 2007 to 2010 conversion issue

    I had this code working in Access 2007 to create emails from Outlook and populate them. THere had bee nan upgrade to 2010 and now I'm getting a run-time error 13 (type mismathc) on the line to Set NewDoc.... Any ideas? I can't figure this out. thanks in advance Private Sub SendEmail_Click()...
  3. S

    Query using And/Or variable from form

    OK, thanks Pat, I got around it using 2 queries, 1 for "and" and 1 for "or". And a dropdown to select and link to desired query.
  4. S

    Query using And/Or variable from form

    I have a search form where users select criteria, which runs the query. e.g. Will return results of location 1 and location 2. I want to make the And a variable so that the query can search either the above or location 1 OR location 2. I have tried replacing the And in the query with the from...
  5. S

    How do i use DLookup???

    You might be able to help we with a similar issue. I'm trying to look up the key and email from the below table. If I input 'SS' into the input box I want to lookup Key=2845 and Email=ss@1.com.au. Code is also below. And is there a way of setting the inputbox as a list box and listing the...
  6. S

    SQL Challenge Update, Inner Join, Set, Where

    Can you write update SQLs in the design grid view? I got around this issue by adding a 2nd update SQL but it would still be good to now how to structure an UPDATE, INNER JOIN, SET SQK with a WHERE statement. If Me.RCSSub = "-1" Then _ dbs.Execute "Update (T1 inner join T2 on T1.Key = T2.Key "...
  7. S

    SQL Challenge Update, Inner Join, Set, Where

    I have a form with a checkbox. If the box is checked I want a table updated. I have the below query, which works but I want to add a where clause and cant figure out where it fits it. Can someone please help with structure. Private Sub RCSSub_AfterUpdate() Dim dbs As Database Dim qdf As...
  8. S

    Importing from an Outlook secondary mailbox

    I am importing emails into Access from Outlook and am having trouble defining the correct mailbox. I have 2 inboxes, I can import from my default one but do not know the code for my 2nd mailbox. I can accomplish this with a .pickfolder command but wish to automate it. I have the below code but...
  9. S

    Saving an outlook attachment

    Thanks Stopher, Changed a few things, mainly your do loop suggestion and got it working well. Only issue is the attachment is not copying to the table, not sure why. Dont need it to be copied as an attachment, text filename would be fine. Any suggestions? Code below for future member...
  10. S

    Saving an outlook attachment

    Thanks Lagbolt, That cleared that error, now I have an Error 13:Type mismatch on line "For Each msg In Inbox.Items". Can you see what I've done wrong? Thanks Private Sub Test_Click() Dim rs As DAO.Recordset Dim Ola As Outlook.Application Dim Nsp As Outlook.NameSpace Dim pf, Inbox, ib, newdest...
  11. S

    Saving an outlook attachment

    Yes it raises an error on the SaveAsFile line - Compile Error: Method or data member not found. I haven't come across that error before so not sure of the way around it. There should only ever be 1 email attachment so I'm not too concerned about that part but if you wanted to distinguish them...
  12. S

    Saving an outlook attachment

    Hi, The below code is intended to: 1. open outlook mail; 2. copy the email details into the database; 3. save the attachment into a E: drive location; 4. move the email to another folder. 1,2 and 4 were working fine until I tries to save the attachment and got stuck on the SaveAs line. Any...
  13. S

    Importing table data from outlook

    Hi, I've got the following code to import email information from outlook into the database, however I'm getting the error: "The connection cannot be used to perform this operation. it is either closed or or invalid in this context" I'm using Access 2007 with references: VB for applications...
  14. S

    Sending Automated Email

    haha, thanks.
  15. S

    Sending Automated Email

    You were right, that works. Nearly there. Only problem is that it's 'saving as' and attaching as an MS doc application. It's weird. Can you see what I've done? Private Sub SendEmail_Click() Dim db As dao.Database Dim rsEmailList As dao.Recordset Dim Path As String Dim objWord As Object Dim...
  16. S

    Sending Automated Email

    ok, How would you structure code to open a word form, populate a form field, attach the form to an email and loop through a recordset?
  17. S

    Sending Automated Email

    Since you guys have been so helpful, I'll exploit your brilliance a little more. The code below is basically the same above but instead of sending out the same form to everyone I want to add their ID to the form before I send it out. This will help getting the data back into the database when...
  18. S

    Sending Automated Email

    Thanks pbaldy, Sorry I didn't read your post properly the first time, my fault. Worked perfectly. You suggested before to have the attachment in the recordset. This is a good idea to send customised attachments and will also be useful to me. Say that I had an Access form that I wanted to...
  19. S

    Sending Automated Email

    I changed the .Display to .Send. The first email sent as expected but it got stuck on the 'To" line of the 2nd record with the error: "This item has been moved or deleted"
  20. S

    Sending Automated Email

    Thanks pr2-eugin, Correct - I am using a form with default text but the attachment, at this stage is the same for everyone. I've removed the .MoveFirst and added the End If but am still getting the same issue. When multiple recipients are selected it is still only producing 1 email with...
Top Bottom