fiogf49gjkf0d Here you go, Phil. The activex control being called is QBAddCustomer
sub CallQBuzz1()
Dim strSQL, sString Dim objRS Dim Form Dim sCurrentAccountID Dim WshShell dim objSLXDB
sCurrentAccountID = Application.MainViews.ActiveView.CurrentID
strSQL = "select a.account, c.firstname, c.lastname, a.mainphone, a.fax, c.email, ad.address1, ad.address2, ad.city, " & _ " ad.state, ad.postalcode from sysdba.account a inner join sysdba.contact c on c.accountid = a.accountid " & _ " inner join sysdba.address ad on a.addressid = ad.addressid WHERE accountid='" & sCurrentAccountID & "' and c.isprimary='t'"
If Not IsObject(objSLXDB) Then Set objSLXDB = New SLX_DB End If
Set objRS = objSLXDB.GetNewRecordset objRS.Open strSQL, objSLXDB.Connection
If Not (objRS.BOF And objRS.EOF) Then objRS.movefirst
' now build the string sString = sString & "|co=" & objRS.Fields("ACCOUNT").Value sString = sString & "|f=" & objRS.Fields("FIRSTNAME").Value sString = sString & "|l=" & objRS.Fields("LASTNAME").Value sString = sString & "|p=" & objRS.Fields("MAINPHONE").Value sString = sString & "|x=" & objRS.Fields("FAX").Value sString = sString & "|e=" & objRS.Fields("EMAIL").Value sString = sString & "|a1=" & objRS.Fields("ADDRESS1").Value sString = sString & "|a2=" & objRS.Fields("ADDRESS2").Value sString = sString & "|c=" & objRS.Fields("CITY").Value sString = sString & "|s=" & objRS.Fields("STATE").Value sString = sString & "|z=" & objRS.Fields("POSTALCODE").Value
End If
objRS.Close Set objRS = Nothing set objSLXDB = nothing
Dim x Dim NewQBID
Set x = CreateObject("QBAddCustomer.NewCust")
x.CustomerData = sString
NewQBID = x.NewQBContact()
Set x = Nothing
if NewQBID <> "" then ' the user created a new QB Customer 'MsgBox "Created New QuickBooks Customer ID: " & NewQBID txtQBLink.Text = NewQBID ' Update the UI lblQBuzz.Visible = false txtQBLink.Visible = true btnConvert.Visible = false
end if
set Form = nothing
end sub |