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
    Posts
    18

    VBA - Save Code

    Hi.

    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
    Else
    Cancel.Value = False
    End If

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

    Thanks.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    If you want to save if they say Yes, why are you canceling?

Similar Threads

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


   Development Centers

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