Results 1 to 9 of 9
  1. #1
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8

    SaveAs Dialogue box


    Hello every one,
    Please help. I am trying to display the saveas dialogue box but is giving me an "object required" error in "CommonDialog1.ShowOpen" even though, I already have Common Dialog OCX in the toolbox, what's missing? Thank yo

    A. Haj

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Ok but what does your code look like. Seeing that may shed light on your plight.

    David

  3. #3
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8

    SaveAs Dialog Box

    Thank you David, here is the code:
    The error "object required" is in "CommonDialog1.ShowSave"

    Private Sub cmdSave_Click()
    On Error GoTo errhandler
    CommonDialog1.CancelError = True
    ' Display the Save dialog box
    CommonDialog1.ShowSave
    CommonDialog1.Filename = ""
    Exit Sub
    errhandler:
    Select Case Err
    Case 32755 ' Dialog Cancelled
    MsgBox "You cancelled the dialog box"
    Case Else
    MsgBox "Unexpected error. Err " & Err & " : " & Error
    End Select
    End Sub

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    You are clearing the filename
    Try

    Code:
     
    Dim strFile as String
    Me.CommonDialog1.ShowSave
    strFile = Me.CommonDialog1.FileName
     
    msgbox strFile

  5. #5
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8
    OK David, I tried that, now it's giving me "Method or data not found", it sounds like it's not recognizing "CommonDialog1", thanx.

  6. #6
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Silly question but you have actually added the common control dialog activeX control to the form haven't you?

    David

  7. #7
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8
    Thank you David, that's not a silly question, actually great one, I thought I did and I just rechecked my toolbox components window and did not see it there, so now am not sure, what to do? Thanks a bunch David.

    A. Haj

  8. #8
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8

    License

    David,
    Because of your question, I tried to add the common control dialog activeX control to the form but gave me this error " You do not have a license to use this control", so I folllowed the instructions on this link,
    http://support.microsoft.com/kb/318597
    and installed it successfully but now it still gives me the "object required" error in CommonDialog.ShowSave or the "Method or data member not found" error in Me.CommonDialog.ShowSave, it does the same if you use CommonDialog1.ShowSave, thanks alot.

    A. Haj

  9. #9
    saqqer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    8

    Solved!

    David,
    I went to the properties window of the common control dialog activeX control on the form and found that the OLE Class is CommonDialog and the Name was CommonDialog4 so I changed it to CommonDialog and success, it worked, thank you.

    A. Haj

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

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