RE: Help with importing

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
Im lost on the query shoukld i have it just query all the data I need?
[quoted text clipped - 25 lines]

End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200610/1

.



Relevant Pages

  • RE: Help with importing
    ... look to see what the value in strFullName is. ... Dim strFullName As String ... Set dbf = CurrentDb ... The make it an Append Query. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Breaking down imported information
    ... Single-record append query: ... ' Check if at EOF of Recordset (rsDataViaCode) ... ' if at EOF Exit Do. ... Dim rsDataViaCode As DAO.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • Re: LDAP query information
    ... Copyright 1985-2001 Microsoft Corp. ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... Set adoConnection = CreateObject ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)
  • Re: LDAP query information
    ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... Set adoConnection = CreateObject ... ' Construct LDAP syntax query. ... Yes, the script uses ADO to query AD directly, which is very efficient - no ...
    (microsoft.public.windows.server.scripting)
  • Re: Need WMI script
    ... I also assume that strGroupName is ... If instead strDomainName is the NetBIOS name of a domain, ... Dim adoCommand, adoConnection, strBase, strFilter, strAttributes, xmlDoc, ... ' Construct the LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)