B
Bill H.
I get a ByRef argument type mismatch error when I try to compile. The code
runs and works, but if I manually tell it to complie, I get an error.
Here is a segment of the code on a form:
dim MtablenameTo as string
If fExistTable(MtablenameTo) Then
The ByRef problem is on the parameter of fExistTable(), a function in a
module:
Function fExistTable(strTableName As String) As Integer
Dim db As Database
Dim i As Integer
Set db = DBEngine.Workspaces(0).Databases(0)
fExistTable = False
db.TableDefs.Refresh
For i = 0 To db.TableDefs.Count - 1
If strTableName = db.TableDefs(i).Name Then
'Table Exists
fExistTable = True
Exit For
End If
Next i
db.Close
Set db = Nothing
End Function
Thanks.
runs and works, but if I manually tell it to complie, I get an error.
Here is a segment of the code on a form:
dim MtablenameTo as string
If fExistTable(MtablenameTo) Then
The ByRef problem is on the parameter of fExistTable(), a function in a
module:
Function fExistTable(strTableName As String) As Integer
Dim db As Database
Dim i As Integer
Set db = DBEngine.Workspaces(0).Databases(0)
fExistTable = False
db.TableDefs.Refresh
For i = 0 To db.TableDefs.Count - 1
If strTableName = db.TableDefs(i).Name Then
'Table Exists
fExistTable = True
Exit For
End If
Next i
db.Close
Set db = Nothing
End Function
Thanks.