Connecting Tech Pros Worldwide Help | Site Map

Extract Data with VBA from table

  #1  
Old November 13th, 2005, 12:36 PM
Tempy
Guest
 
Posts: n/a
Hi All, i have a table called "tblTotalLcPO'sDept" and it has the fields
"ByrDept" & "Total LC PO's". I need to extract the value for the
respective Departments in the field "ByrDept" e.g. "ByrDept" = ZA-TM-3 &
"Total LC PO's" = 230.

I need to get the number 230, is it possible and if could you tell me
how. I use the following to get a value from a field:myTotTm3 =
DLookup("[ByrDept]", "tblTotalLcPO'sDept")

The above gives me the first Dept ZA-TM-3, but i need the number ?

I have 3 departments, ZA-TM-3, ZA-TM-4 & ZA-TM-5.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2  
Old November 13th, 2005, 12:36 PM
Tempy
Guest
 
Posts: n/a

re: Extract Data with VBA from table


Thanks all, i solved the problem myself....It shows what one can do if
you use a bit of brain power !!
myTotTm3 = Nz(DLookup("[Total LC PO's]", "tblTotalLcPO'sDept",
"[ByrDept]='ZA-TM-3'"), 0)

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem trying to write a PL/SQL routine that will generate a CREATE TABLE statement nanabuch answers 4 November 29th, 2007 03:30 PM
Running SQL query for each record in table mikewilli answers 0 July 10th, 2007 02:49 PM
"Long binary data" in Access db Jerry answers 8 November 13th, 2005 12:12 PM
Word Table to Access Ruby Tuesday answers 41 November 13th, 2005 05:07 AM