Jumat, 28 April 2017

Re: [MS_AccessPros] Error 2501; OpenForm command is cancelled

 

does the form being opened have an Open event that is being Canceled in VBA?

is Me.lstSpecNames.Value for OpenArgs? Does it have a value?

since dialog is specified  ... is it possible another form is already open using dialog?


On 4/28/2017 2:23 PM, david.pratt@outlook.com [MS_Access_Professionals] wrote:
I have a command button on a form with a simple DoCmd.Open form statement.  I keep getting (2 hours worth) error 2501 when I click this cmdButton.  the error table says I am manually cancelling a form I am trying to open with VBA.  I am using the very same VBA for this button I have used for 20 other buttons.  I have looked at the form properties I am trying to open and I cannot find any problems.  The code never opens the form anyway; it errors on the DoCmd statement of the calling form.

If lstSpecNames.ItemsSelected.Count = 0 Then
        MsgBox "Must select a Specification to add the parameters to!" _
        , vbInformation, "No Specification Selected"
        Me.lstSpecNames.SetFocus
Else
        DoCmd.OpenForm "frmSpecDetails", acNormal, , , acFormAdd, acDialog, Me.lstSpecNames.Value
        Me.lstSpecDetails.Requery
End If

Can anyone tell me where I can look to find my error?



__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar