I am trying to setup a Sales Order Trigger that will pull in a user field from the customer table when someones enters a customer id. The same way it automatically pulls in all shipping/billing info for that customer. Here is the VBA i have written but its not working. Any help is appreciated as I am still learning.
inserted safmaskedtext (xloyalty) and linked to user3 of soheader
New module
Type loyalty
user3 as string * 30
End Type
Global bloyalty As loyalty
This screen code
Private Sub ccustid_1_Chk(ChkStrg As String, retval as Integer)
Dim Cur As Integer
Dim SQL as String
SQL="SELECT User5 FROM Customer WHERE Custid="&SParm(ChkStrg)
Call SqlFetch1(Cur, SQL, bloyalty, LenB(bloyalty))
Call SetObjectValue("xloyalty", bloyalty.user3)
SqlFree (Cur)
Close (Cur)
End Sub
*This post is locked for comments