Question : ACCESS 2000 - Opening a Snapshot Recordset

I haven't programmed this in years.  Sorry.  

In  a VBA module and using DAO connections:
I need to open a linked Table "dbo_PRException", locate a specific record identified by EMPNO, and then extract 6 data fields, Ded1, Ded2, etc. and put the data from them into an array Deducts(6).  I then will operate on the data.

I started with:
            Dim db As dao.database, rst As dao.Recordset
            Dim Deducts(6) as Integer

            Set db = CurrentDb
            Set rst = db.openrecordset("dbo_PRException", dbOpenSnapshot)

As usual I will greatly appreciate your help.

Answer : ACCESS 2000 - Opening a Snapshot Recordset

Dim db As dao.database, rst As dao.Recordset
 Dim Deducts(6) as Integer
dim strsql as string
dim x
strsql = "Select Empno, ded1,ded2,ded3,ded4,ded5,de6 from dbo_PRException where empno =  99999"
Set db = CurrentDb
 Set rst = db.openrecordset(strsql,dbOpenSnapshot)
if not rst.eof then
for x = 1 to 6
deduct(x) = rs(x)
Next x
' do something with the array.....
rs.close
set rs = nothing
set db = nothing
Random Solutions  
 
programming4us programming4us