web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA event

(1) ShareShare
ReportReport
Posted on by

Hi,


By some reason I don't know this: AfterLostFocus() event is not working automatically , why? it's used to work.

Private Sub Nmordencompracliente_AfterLostFocus()

Dim valor As Integer
 If (Me.Nmordencompracliente.Value <> "") Then
 valor = BuscarNumeroBl(Me.Nmordencompracliente.Value)
 If valor > 0 Then
MsgBox "¡Este número ya existe " + CStr(valor) + " Veces! (O_o)"
End If
End If
End Sub

*This post is locked for comments

I have the same question (0)
  • Tim Foster Profile Picture
    8,515 on at

    I'm sorry if this seems like a silly question, but...

    If you set a breakpoint on your first "If" statement,  the code never executes?

    The VBA project could be corrupt.

    Tim

  • Verified answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    AfterLostFocus is working for me. I am not sure about BuscarNumeroBl (what is this doing), I have just change your code a little and it should work.

    Private Sub Nmordencompracliente_AfterLostFocus()
    
    Dim valor As Integer
    
    If (Me.Nmordencompracliente.Value <> "") Then
            
            If BuscarNumeroBl(Me.Nmordencompracliente.Value) > 0 Then
                  MsgBox "¡Este número ya existe " + CStr(valor) + " Veces! (O_o)"
            End If
            
    End If
    
    End Sub
  • Community Member Profile Picture
    on at

    Hi, it worked, and BuscarNumeroBl is a S_Procedure, I realized that my sql connection user had not permission to this SP. Thanks! you are really good guys!.

  • Community Member Profile Picture
    on at

    You are helping me, I'm glad! never mind to make any questions, I did what you said, and it worked (the break point). Thanks, my friend.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans