sobotta edisi 23 (jilid 3) download.
Category:Educational psychology
Category:PedagogyQ:
Generic Imported Table results in Type Mismatch error
I have a form with several tables that were import from a.txt file. One table holds addresses and is used as an address form. I am able to use the form with the other tables but not the address table. If i type in an address then I get Type Mismatch error. This is because the table that it is supposed to import from is in a separate project and is not loaded when I try to import this table. I tried to import it using the 'Declare - Table of Generic Form' (see below) but I get a error that I have used the wrong type of Declare. I have tried with text, array and variant, I get a same error with all 3.
My code is:
'Delete all other tables in the database
Sub DeleteTables()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set dbs = CurrentDb
With Sheets("Sheet1")
.ListObjects.Add(SourceType:=xlSourceReadWrite, Source:=Array( _
Array( _
"Tablename", _
"Declare - Table of Generic Form", _
"field 1", "field 2", "field 3" _
), Range(.Cells(1, 1),.Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 1)).Address _
), Destination:=.Range("$A$1")
)
.ListObjects("TableName").Update
End With
'Import the Form
Set rst = dbs.OpenRecordset("ImportTables")
rst.MoveFirst
Do While Not rst.EOF
With Sheets("Sheet1")
.ListObjects("TableName").Import rst, _
Type:=xlDatabase, _ ac619d1d87
Related links:
Comments