Results 1 to 4 of 4
  1. #1
    rapaint66 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    2

    Add Contact from Outlook in a Subform

    I have a form that uses the command AddContactfromOutlook. I used the standard example given by Microsoft and it works flawlessly in the form. When I use the form as a subform this command button breaks. Any ideas?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe if you post the code you used, we could start to understand where the problem is.

  3. #3
    rapaint66 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    2
    Quote Originally Posted by ItsMe View Post
    Maybe if you post the code you used, we could start to understand where the problem is.
    This is the standard code from Microsoft. I did not write it. Basically there is a command button tied to an embedded Macro on my form.
    When I create a new form and add the subform control to it and move my form to it. The command button no longer functions. Works fine in the form but when the form is used as a subform it breaks.

    Here is the micrsoft code:
    '------------------------------------------------------------
    ' cmdAddFromOutlook_Click
    '
    '------------------------------------------------------------
    Private Sub cmdAddFromOutlook_Click()
    On Error GoTo cmdAddFromOutlook_Click_Err
    On Error Resume Next
    DoCmd.RunCommand acCmdAddFromOutlook

    cmdAddFromOutlook_Click_Exit:
    Exit Sub
    cmdAddFromOutlook_Click_Err:
    MsgBox Error$
    Resume cmdAddFromOutlook_Click_Exit
    End Sub

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by rapaint66 View Post
    ...When I create a new form and add the subform control to it and move my form to it...
    I am not a big fan of embedded Macros so I do not have much experience with them. If you have a form with a Command Button and you embed a macro to the Command Button, you will need to keep that form as is. In other words, copying the Command Button to other form objects will not create the desired results.

    I suggest creating the form and subform first. You can edit the form Object within the subform container while in design view of the Main Form. Select the subform control/container and then select the form object itself by clicking the object inside the container. Now you can add a new Command Button and embed a macro.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export contact information from Outlook to Access
    By erikl1 in forum Import/Export Data
    Replies: 14
    Last Post: 12-31-2013, 06:36 AM
  2. Link existing names in Access DB to Outlook contact
    By mikejoka in forum Import/Export Data
    Replies: 1
    Last Post: 08-30-2013, 12:24 PM
  3. add to Outlook Contact
    By sdel_nevo in forum Programming
    Replies: 2
    Last Post: 06-10-2013, 01:07 AM
  4. Replies: 8
    Last Post: 06-02-2012, 01:27 AM
  5. Replies: 0
    Last Post: 06-19-2007, 09:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums