R
Rocky
I have a long list of numbers and names which I imported from a .pdf file.
In the .pdf file they were a single string. After stripping off unprintable
characters and separating the numbers and names with a query, I want to use
each name for a field name in a separate table. My problem is getting the
code to find the field in the query (a calculated value) and store the value
to a variable which I can then use as a field name. Following is the code:
Sub CreateTableDefX()
Dim dbsGeneralThoracic As Database
Dim tdfNew As TableDef
Dim prpLoop As Property
Dim fldName As Field
Dim recno As Long
Set dbsGeneralThoracic = CurrentDb
Set dbsGeneralThoracic = OpenDatabase("I:\Database\Thoracic
database\General Thoracic.mdb")
DoCmd.OpenQuery "qryProcSpecImport"
' Create a new TableDef object.
Set tdfNew = dbsGeneralThoracic.CreateTableDef("tblProcedures")
recno = 1
Do While recno < 125
DoCmd.GoToRecord acDataQuery, "qryProcSpecImport", acNext, recno
Set fldName = Proc
On the last line above is where I get the error message, "Compile error:
type mismatch"
Help!
In the .pdf file they were a single string. After stripping off unprintable
characters and separating the numbers and names with a query, I want to use
each name for a field name in a separate table. My problem is getting the
code to find the field in the query (a calculated value) and store the value
to a variable which I can then use as a field name. Following is the code:
Sub CreateTableDefX()
Dim dbsGeneralThoracic As Database
Dim tdfNew As TableDef
Dim prpLoop As Property
Dim fldName As Field
Dim recno As Long
Set dbsGeneralThoracic = CurrentDb
Set dbsGeneralThoracic = OpenDatabase("I:\Database\Thoracic
database\General Thoracic.mdb")
DoCmd.OpenQuery "qryProcSpecImport"
' Create a new TableDef object.
Set tdfNew = dbsGeneralThoracic.CreateTableDef("tblProcedures")
recno = 1
Do While recno < 125
DoCmd.GoToRecord acDataQuery, "qryProcSpecImport", acNext, recno
Set fldName = Proc
On the last line above is where I get the error message, "Compile error:
type mismatch"
Help!