Send Excel2000 data from different tables

I need to send data from three seperate tables. One table determines if a person is on leave, if this is false I then need to see if the person is on a shift change, if this is false then I need to get the persons original shift.  If either one of the first answers is true I need it to populate a cell in Excel.  Basically I need only the true answer to be sent to Excel where it can then be printed out.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

1. Where are the tables stored? Database or document?
2. If database then what type of database?
MissileAuthor Commented:
Tables are stored in Access.
from where do u want to trigger the action that implements the logic?
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

So what is the problem?
You want up to 3 select statements and link to Excel's object model.

Which bit are you having trouble with...?
place a ref. to excel object lib. 8.0

put this code in a project

if your excel workpaper already exsists:

Dim Myexcel as Excel.WorkSheet
Set Myexcel = getobject(filename)

if not:
Set Myexcel = createobject(Excel.worksheet.8)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
On Error GoTo ErrorH

Dim xlapp As Excel.Application
Dim datasheet As Excel.Worksheet
Dim mRng As Excel.Range

Dim curdb As ADODB.Connection
Dim rsCases As New ADODB.Recordset

Dim mRow As Long

Set xlapp = GetObject(, "Excel.Application")
If xlapp Is Nothing Then
    Set xlapp = New Excel.Application
End If

xlapp.Visible = True

xlapp.Workbooks.Open ("C:\WINDOWS\Profiles\Shreyas\Desktop\Case Register\dees_Mact_Cases.xls")

Set datasheet = xlapp.ActiveWorkbook.Sheets("data sheet")

Set curdb = CurrentProject.Connection

rsCases.Open "cases", curdb, adOpenDynamic, adLockPessimistic

mRow = 2

Do While mRow <> 319

    If mRow = 153 Then
    End If
    rsCases(0) = datasheet.Range("a" & mRow)
    rsCases(1) = datasheet.Range("b" & mRow)
    rsCases(2) = datasheet.Range("c" & mRow)
    rsCases(3) = datasheet.Range("d" & mRow)
    rsCases(4) = datasheet.Range("e" & mRow)
    rsCases(5) = datasheet.Range("f" & mRow)
    rsCases(6) = datasheet.Range("g" & mRow)
    rsCases(7) = datasheet.Range("h" & mRow)
    rsCases(8) = datasheet.Range("i" & mRow)
    rsCases(9) = datasheet.Range("j" & mRow)
    rsCases(10) = datasheet.Range("k" & mRow)
    rsCases(11) = datasheet.Range("l" & mRow)
    rsCases(12) = datasheet.Range("m" & mRow)
    rsCases(13) = datasheet.Range("n" & mRow)
    rsCases(14) = datasheet.Range("o" & mRow)
    rsCases(15) = datasheet.Range("p" & mRow)
    rsCases(16) = datasheet.Range("q" & mRow)
    rsCases(17) = datasheet.Range("r" & mRow)
    rsCases(18) = datasheet.Range("s" & mRow)
    rsCases(19) = datasheet.Range("t" & mRow)
    rsCases(20) = datasheet.Range("u" & mRow)
    rsCases(21) = datasheet.Range("v" & mRow)
    rsCases(22) = datasheet.Range("w" & mRow)
    rsCases(23) = datasheet.Range("x" & mRow)
    rsCases(24) = datasheet.Range("y" & mRow)
    rsCases(25) = datasheet.Range("z" & mRow)
    rsCases(26) = datasheet.Range("aa" & mRow)
    rsCases(27) = datasheet.Range("ab" & mRow)
    rsCases(28) = datasheet.Range("ac" & mRow)
    rsCases(29) = datasheet.Range("ad" & mRow)
    rsCases(30) = datasheet.Range("ae" & mRow)
    rsCases(31) = datasheet.Range("af" & mRow)
    Debug.Print mRow
    mRow = mRow + 1

Exit Sub

    If Err.Number = 429 Then
        Resume Next
        MsgBox Err.Description, vbInformation, "Error - " & Err.Number
    End If

'here is an generic procedure for one time retrival of data from an excel sheet into an access table. I am not sure if this would help in your case or not perfectly but partially it would address your problem. And oh, dont forget to add an ref. to the excel library first
MissileAuthor Commented:
The program I'm writing is a scheduling program for personnel. It uses VB as the front but stores data in Access to 3 tables. When the program starts it gets the data from the 3 tables using multiple queries.  This populates a daily crewsheet which consists of 7 crews with 10 individuals working a 24 hour period. I have already designed a sign in sheet in excel, now I need to populate this sheet with daily data from the different tables as well as additional data that the daily crewsheet did'nt get from access and then print out and shut down excel.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.