RE: Help with importing
- From: "jln via AccessMonster.com" <u25956@uwe>
- Date: Fri, 06 Oct 2006 16:44:21 GMT
Klatuu Does this look right im getting an error Typ mismatch
Private Sub Command0_Click()
Dim StrFolder As String
Dim strFullName As String
Dim dbf As Database
Const conFilter As String = "\*.xls"
Set dbf = CurrentDb
StrFolder = ("S:\Iashare\0Subprime\Payoffmissmatch")
If Len(StrFolder) = 0 Then
MsgBox "Import Canceled"
Exit Sub
End If
strFullName = Dir(StrFolder & conFilter)
Do While Len(strFullName) <> 0
DoCmd.TransferSpreadsheet , acLink, , "PayoffMisMatch", strFullName,
True (HERE)
dbf.Execute ("qry_PayoffMismatch"), dbFailOnError
DoCmd.DeleteObject acTable, "PayoffMisMatch"
Loop
Set dbf = Nothing
End Sub
Klatuu wrote:
To run it, ut a command button on a form. Put the code in the Click Event of
the button.
First, manually link to one of your spreadsheets. Then open the query
builder and select the linked table. The make it an Append Query. Give it
the name of your table in the Append To. Make sure your fields match up like
you want them.
Save the query, delete the link to the spreadsheet.
In your previous post, you said the folder would always be the same. In
that case, you don't need the call to the BrowseFolder, but if I were you, I
would leave it in. You never know when things may change.
Ok i think i have the code Right now. WHats the best way to call this? Also[quoted text clipped - 25 lines]
Im lost on the query shoukld i have it just query all the data I need?
End Sub
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200610/1
.
- Follow-Ups:
- RE: Help with importing
- From: Klatuu
- RE: Help with importing
- References:
- Help with importing
- From: jln via AccessMonster.com
- RE: Help with importing
- From: jln via AccessMonster.com
- RE: Help with importing
- From: Klatuu
- RE: Help with importing
- From: jln via AccessMonster.com
- Help with importing
- Prev by Date: Passing an array to function
- Next by Date: Syntax error with INSERT into command
- Previous by thread: RE: Help with importing
- Next by thread: RE: Help with importing
- Index(es):
Relevant Pages
|