Results 1 to 6 of 6

Thread: pop up message

  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Unanswered: pop up message

    i have a form for wokers to manually change stock of an item that is bought.
    i want a pop up message when the form is closed that says "have you changed stock"if they click no, the form remains open for them to do so, if they click yes the form closes and next form opens.
    is this possible?a mocro is already being run on the "on close" bit of properties to open another form.
    i really dont know what to do, any help would be great!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    In your UnLoad event put the msgbox ... Set the Cancel parameter to non-zero to prevent exit from the form ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2004
    Posts
    277
    Before your close statement

    Dim ask As VbMsgboxResult

    ask = Msgbox("Have you changed stock?",vbYesNo,"Something)

    If ask = vbYes Then
    DoCmd.Close acForm, "whateveritis"
    DoCmd.OpenForm blah blah
    End If
    If ask = vbNo THen
    Msgbox "Please change stock",,"Change Stock"
    End If

    Try that
    Last edited by DackJaniels; 02-15-05 at 15:37.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by DackJaniels
    Before your close statement

    Dim ask As VbMsgboxResult

    ask = Msgbox("Have you changed stock?",vbYesNo,"Something)

    If ask = vbYes Then
    DoCmd.Close acForm, "whateveritis"
    DoCmd.OpenForm blah blah
    End If
    If ask = vbNo THen
    Msgbox "Please change stock",,"Change Stock"
    End If

    Try that
    But WHERE????
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Dec 2004
    Posts
    277
    Quote Originally Posted by M Owen
    But WHERE????
    Put a Command Button on the form to Close

    and then put the code in

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    as an alternative how about checking to see if the stock figure has actually changed, and if not then ask the question. Personally I find being asked such questions when I already know I have doen the deed infuriating - it leesons my faith in the application.

    have a look at the controls oldvalue property - you may need to access it after update, alternatively set a flag if there have been changes to the stock.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •