VBA - Save Code

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: VBA - Save Code

  1. #1
    Join Date
    Apr 2007

    VBA - Save Code


    I got a problem, not a very big problem but a problem.

    I have this code....
    And I want it to only save wend a msgbox shows up with a YES or NO choice.

    Private Sub Form_CommandBeforeExecute(ByVal Command As Variant, ByVal Cancel As Object)
    Dim anser As Integer
    Dim question As string

    question = "Do you want to save?"

    anser = MsgBox("Do you want to save?", vbYesNo)

    If anser = vbYes Then
    Cancel.Value = True
    Cancel.Value = False
    End If

    If you didnt get the questio say something and I will try to explain
    in a diferent way.


  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    If you want to save if they say Yes, why are you canceling?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Print to CutePDF from VBA Code
    By mr_sav in forum VB Classic
    Replies: 12
    Last Post: 11-25-2007, 04:48 AM
  2. Why integer and int32
    By Michael Culley in forum .NET
    Replies: 154
    Last Post: 05-10-2002, 12:06 PM
  3. wot is CLR
    By lostguy in forum .NET
    Replies: 8
    Last Post: 04-03-2002, 06:41 PM
  4. Data Environment Add, Save, Delete Code
    By Helson in forum VB Classic
    Replies: 1
    Last Post: 03-30-2002, 02:46 PM
  5. Brain Washing
    By Danny Bowman in forum .NET
    Replies: 152
    Last Post: 09-13-2001, 07:23 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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center