A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

query in code



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 31st 07, 08:20 PM posted to microsoft.public.outlook.program_vba
Joel Allen
external usenet poster
 
Posts: 117
Default query in code

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
---------------------------


Thanks,
Joel


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query about stationary Andrea Outlook - General Queries 3 January 24th 07 05:29 PM
Query Capt K Ripendran Outlook Express 2 December 12th 06 05:22 PM
Query Capt K Ripendran Outlook Express 7 November 15th 06 11:43 PM
a query Marion Dempsey Outlook Express 2 April 30th 06 10:37 PM
Running query from Access Form commmand using VBA code Berny Outlook and VBA 4 January 16th 06 02:12 PM


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.