View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jasontferrell jasontferrell is offline
external usenet poster
 
Posts: 56
Default Copy cell contents to access form

When your line for the transferspreadsheet says "ActiveCell", it's
referring to the active cell of the spreadsheet that's currently
open. This parameter of the TransferSpreadsheet method is looking for
the range that you'd like to import from the Excel file ("A1:B100" or
something like that). The way it's written, it's like you're trying
to move the data from the Excel file into a table in Access called
"Search".

Reading what you actually want to accomplish, it sounds like you might
need to dynamically change the parameters of a query, then display the
result in Access.
Without fully testing, that might look something like this:
With appAcc
.Visible = False
.OpenCurrentDatabase "C:\Documents and Settings\User\My
Documents\Works in progress\database stuff\Copy of job list.mdb"
.CurrentDb.QueryDefs("SearchQuery").Sql = "select * from
SearchTable where Job='" & ActiveCell.Value & "'"
.DoCmd.RunMacro "Search"
.Visible = True
End With