Forms replaced msgboxes

  • Thread starter Thread starter thien
  • Start date Start date
T

thien

Guest
I have a form and a delete record button that I created myown.
Can you tell me how to make a function that replacing the msgbox.

How to make process when I click button "delete" a form will appear to confirm me if I need to delete (It is not a msgbox with yes & no buttons) support that with two buttons named "i agree" & "not agree" for example. When we click the button "i agree" it will delete the recent record. if we click button "not agree" it will do not thing!
Need your help as soon as possible
 
Thien,

I would still strongly consider using the msgbox function and have the following as part of your on click button for the deletion, followed by the deletion code. What is the reason for not following this route as it is much simpler and quicker?

Code:
strMsg = MsgBox("Are you sure you want to run the import?.  ", vbYesNo)

    If strMsg = vbNo Then ' Provides user with an option to continue or cancel
        Exit Sub
    End If

If you still want to go down the form route, open a form (docmd.openform "frmName") that is modal, ie the user can't shift focus off it until it is closed.

Have the text you require and two buttons on the form. One button will just close the form, the other will run your deletion code and then close the form.

Hope this answers your questions
 

Users who are viewing this thread

Back
Top Bottom