View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Bringing Data From Access To Excel

Look at the links that Duke Carey and Ron de Bruin have provided - they
should help some. In the end, you're going to return a recordset that
contains the information you want. I presume it will be a 1-record-deep
recordset pertaining to the specific contract number you provided. That
recordset is going to be just like the table it came from: have fields of the
same name. You then take each field and put it into a cell. Assuming that
you've got the cell with the contract ID in it selected in a worksheet and
you want to put the fields of data in the same row, you could use something
like:

With rstReturnedRecord
ActiveCell.Offset(0, 1) = !ContractManager
ActiveCell.Offset(0, 2) = !ContractValue
ActiveCell.Offset(0, 3) = !StaffSize
ActiveCell.Offset(0, 4) = !LastInvoice
End With
to move the individual elements from the returned recordset
(rstReturnedRecord) onto the sheet.

"Alistaire Green" wrote:

Thanks Jlathem,

I uderstand the code you have typed, but im a little confused how we can get
other cells in a excel sheet to populate accourding to the Contract Number is
in the Cell.

Eg

Cell A1 is where you type the contract Number.

Then from putting the Contract Number in cell A1 all the other cells which
automatically populate.

Not know if im onto a loose end but if there is further help you can give fr
me to get my head wrong this i would appreciate it :)