Quantcast
Channel: Microsoft Dynamics GP Forum - Recent Threads
Viewing all articles
Browse latest Browse all 14686

VBA If Statement on window

$
0
0

Hello

When you have Sales Transaction Entry window open there is another window you can drill through to called Sales Debtor Detail Entry.

In the VBA Project under SalesDebtorDetailEntry (Window) the following If Statement works fine -

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)

If Me.BillToAddressID = "MAIN" Then
Cancel = True
MsgBox "Change 'Bill To Address ID' to Order Number"
End If

End Sub


The Same If Statement Under SalesTransactionEntry (Window) errors

Private Sub Save_BeforeGotFocus(CancelLogic As Boolean)

If Me.DebtorID = "ECOMCASH" And SalesDebtorDetailEntry.BillToAddressID = "MAIN" Then
Cancel = True
MsgBox "Change 'Bill To Address ID' to Order Number"

End If


I can't figure out why, I've done many If statements that look at values in other windows. Any ideas?? Thanks


Viewing all articles
Browse latest Browse all 14686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>