J
Joel Allen
Hello,
I'm pulling info over from another database into a field. This normally
works, but for this one, I'm using a SUM command and something is not
working. I think I just have a bit of syntax that is off. I think it's
getting hung up in the select statement, or below that were I try to copy
the value. Can anybody help?
------------------------------------------------------------------------
Set oRS = Application.CreateObject("ADODB.Recordset")
oRS.Open "Select Sum(FI_BETR_NETTO) FROM BW_Auftr_Kopf WHERE ID = '" &
Trim(Item.UserProperties("CustomerNum").Value) & "'", _
oDBConn, adOpenKeyset
If Not oRS.BOF and Not oRS.EOF Then
Item.UserProperties("PendingAlfakOrders").Value = oRS("Sum(FI_BETR_NETTO)")
Else
MsgBox "No Database record found for this Customer ID value.6",
vbExclamation
End If
oRS.Close
Set oRS = Nothing
I'm pulling info over from another database into a field. This normally
works, but for this one, I'm using a SUM command and something is not
working. I think I just have a bit of syntax that is off. I think it's
getting hung up in the select statement, or below that were I try to copy
the value. Can anybody help?
------------------------------------------------------------------------
Set oRS = Application.CreateObject("ADODB.Recordset")
oRS.Open "Select Sum(FI_BETR_NETTO) FROM BW_Auftr_Kopf WHERE ID = '" &
Trim(Item.UserProperties("CustomerNum").Value) & "'", _
oDBConn, adOpenKeyset
If Not oRS.BOF and Not oRS.EOF Then
Item.UserProperties("PendingAlfakOrders").Value = oRS("Sum(FI_BETR_NETTO)")
Else
MsgBox "No Database record found for this Customer ID value.6",
vbExclamation
End If
oRS.Close
Set oRS = Nothing