none
Required Custom Yes or No Pop up window RRS feed

  • Question

  • Dear All,

        * While Saving the Data into the table from MS Access form  I am getting pop-up windows as below .

         * But I want to show the pop-up window with "yes" or "no" button showing my own information and if clicked yes saving the data and by selected no discarding the data from saving into the table.Can any one help me how can I do this


    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .

    Saturday, July 11, 2015 8:14 AM

Answers

  • If you've followed the advice given, you should not be experiencing this behaviour.  The Execute method of the Database object does not prompt for user confirmation.  I can only assume that you are still calling the OpenQuery or RunSQL method of the DoCmd object.  If you are doing so, then you need to turn off warnings before doing so with:

        DoCmd.SetWarnings False

    and turn them on again afterwards with:

        DoCmd.SetWarnings True

    Be sure to do the latter in the procedure's error handler or you might easily leave warnings turned off for the duration of the session.

    Ken Sheridan, Stafford, England

    • Marked as answer by SP Assest Sunday, July 12, 2015 12:37 PM
    Sunday, July 12, 2015 12:19 PM

All replies

  • I assume you are trying to execute an update query from a form and you are using DoCmd.RunSQL method.  If you use the CurrentDB.Execute method, you will not get the Access message box.  You can then supply your own custom message.  See the following example:

    Private Sub DoUpdate()
        
        On Error GoTo Err_Process
        
        Dim intResponse As Integer
        Dim strMsg As String
        Dim strSQL As String
        
        strSQL = "UPDATE [TableName] SET [FieldName] = Value"
        
        strMsg = "You are about to update records.  Proceed?"
        
        intResponse = MsgBox(strMsg, vbExclamation + vbYesNo, "Update Records?")
        
        If (intResponse = vbYes) Then
            CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
        End If
        
    Exit_Process:
        Exit Sub
        
    Err_Process:
        'You error handler
        Resume Exit_Process
        
    End Sub
    

    Saturday, July 11, 2015 2:08 PM
  • Hello 

         Thank you very much for your response.I am able to get the custom message ,But still I am facing default message after my custom information.Can you please let me know how can I avoid it.


    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .

    Sunday, July 12, 2015 10:46 AM
  • Please post your code so that I can see what you are doing...
    Sunday, July 12, 2015 12:14 PM
  • If you've followed the advice given, you should not be experiencing this behaviour.  The Execute method of the Database object does not prompt for user confirmation.  I can only assume that you are still calling the OpenQuery or RunSQL method of the DoCmd object.  If you are doing so, then you need to turn off warnings before doing so with:

        DoCmd.SetWarnings False

    and turn them on again afterwards with:

        DoCmd.SetWarnings True

    Be sure to do the latter in the procedure's error handler or you might easily leave warnings turned off for the duration of the session.

    Ken Sheridan, Stafford, England

    • Marked as answer by SP Assest Sunday, July 12, 2015 12:37 PM
    Sunday, July 12, 2015 12:19 PM
  • Hello Ken,

               Thank you very much for your response.And I found the result.Could you please help me for the below issue

    https://social.msdn.microsoft.com/Forums/office/en-US/4d261057-ed7f-4f5d-bb94-5341053fee63/filter-report-by-passing-parameter-from-ms-access-form?forum=accessdev


    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .

    Sunday, July 12, 2015 12:36 PM
  • Sid,

    I have to say that is difficult to want to provide any additional help to you.  The answer was provided to you in my previous post and Ken pointed out that if you had followed instructions, you would not be getting the default message box.  Because you fail to follow instructions in each of your posts, you then require each of us to exert unnecessary additional and time consuming efforts to force feed you the regurgitated information. 

    You really need to learn to help your self my friend, firstly by following instructions when given.  You also need to take the time to look some of this up yourself.  It's not hard to do.  Most of what you have asked in your posts is answered in the Access/VBA help files.  If not there, Google has plenty of information as well. 

    As for your current question here, though Ken's last post provides a work around to the situation you were facing after my help, it is not the most efficient method for doing this procedure.  Again, had you simply followed the example, you would not have needed this work around or additional help.

    'nuff said.


    Sunday, July 12, 2015 2:28 PM
  • Rather than posting your code corrections, I have modified your entire DB so that all object naming is more in line with best practices and your code has been cleaned up.  I have posted to OneDrive at the following address:

    https://onedrive.live.com/redir?resid=E55A76D6EB477199!113&authkey=!ALS7s8AJXoZ4wTc&ithint=file%2caccdb

    Let me know if you have problems accessing it.

    Be sure to review all code and objects for reference when performing additional development.

    Feel free to post back with comments or questions.



    Sunday, July 12, 2015 5:11 PM