Results 1 to 5 of 5
  1. #1

    Connect to Access Table

    In code, is it possible to link to an Access database table? Usage: I have a customer who does a lot of email mailings (it's an association). Since they work with different groups, and those list members change frequently, I thought I'd use code to (1) do a make table (2) open outlook (3) create a new email message (4) set "To:" equal to a distribution list, which happens to be the access table.

    I've tried another route, using Helen Feddema's code, but that requires you to copy all the records to outlook first, which is time-consuming.

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Roanoke area, Virginia, USA
    Thanked 0 Times in 0 Posts

    Re: Connect to Access Table

    check at <A target="_blank" HREF=>slipstick</A> to be sure. I think ADO will do it, but it might be using similar code to Helen's. It's been so long since i toyed with it, but i think it was outlook populating Access, and you want Access to popualr Outlook...

  3. #3

    Re: Connect to Access Table

    That wasn't any help. Everything I'm finding is showing how to link to Outlook from an Access database. I need to link to an access table from within Outlook. <img src=/S/dizzy.gif border=0 width=15 height=15>

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: Connect to Access Table

    Because VBA wasn't added to Outlook until 2000, you will find a lot more examples for Word (e.g., mail merge) and Excel than for Outlook. Nevertheless, the principles are the same. I personally have not recoded my DAO code to ADO, so it's probably too quaint to share here. But I suggest finding examples for Word or Excel.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Houston, Texas, USA
    Thanked 0 Times in 0 Posts

    Re: Connect to Access Table

    Do you want a pull down field that gets its information from an Access table.

    I have a client field in my form that is a pull down. It will display all the names in the table

    Function Item_Open()
    ' pulldown for client information
    Dim rst1
    Dim dao
    Dim wks
    Dim db
    Dim nms
    Dim fld
    Dim itms
    Dim itm
    Dim strAccessDir
    Dim objAccess
    Dim CategoryArray(99, 2)
    Dim CustomerArray(99, 2)

    'Pick up path to Access database directory function
    Set objAccess = Item.Application.CreateObject("Access.Application" )
    strDBName = ("tabsproddatabaseedgarcigarscontrol room.mdb")
    'MsgBox "DBName: " & strDBName

    'Set up reference to Access database
    Set dao = Application.CreateObject("DAO.DBEngine.35")
    Set wks = dao.Workspaces(0)
    Set db = wks.OpenDatabase(strDBName)

    'Retrieve Category info from table
    Set rst1 = db.OpenRecordset("Work4number")
    Set ctl = Item.GetInspector.ModifiedFormPages("Tape Transfer Request").Controls("cboClient")

    ctl.ColumnCount = 2
    ctl.ColumnWidths = "120; 40 pt"

    'Assign Access data to an array of 2 columns and 100 rows
    CategoryArray(99, 2) = rst1.GetRows(100)

    ctl.Column() = CategoryArray(99, 2)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts