• Common Dialogue Control

    Author
    Topic
    #352683

    Hello.

    I am using the Common Dialogue Save As function within my application. The problem is, regardless of whether the user presses Save, or Cancel, the object saves the output.

    I need some code for the cancel option. Can anyone help?

    Viewing 1 reply thread
    Author
    Replies
    • #513696

      jonathan,
      Not too sure about the Save as function that you refer to.
      Do you mean dlgMyCommonDialog.ShowSave ? If so use the control to return a string which is the UNC of the file that the user wants to create. then use the docmd.save command to save the required data to the file.
      To pick up on the Cancel possibility put an if statement after the strMyUNC = dlgCommonDialog.ShowSave like
      if strMyUNC = vbcancel then
      exit sub
      else
      docmd.save …
      end if

      • #513703

        Cheers for the reply, but I am a little more confused.(I am using the ShowSave).
        What do you mean by UNC?

        • #513706

          UNC – Universal Naming Convention
          anything that looks like “C:My Documentsfile….”
          basically a drivedirectoryfile location

          • #513711

            Still no joy.
            The Common Dialogue part is being used as an output for transferspreadsheet action, with the path to where the spreadsheet is to be saved to being the result from the common dialogue.
            I don’t think the docmd.save will work for this.

    • #513891

      The problem is that I build the filename for the user, specifying it as commondialog.FileName. I am not sure if the method you offered will work for me.

      I am looking at commondialog.cancelError now but struggling.

      Any more help?

    Viewing 1 reply thread
    Reply To: Common Dialogue Control

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: