Should be simple: incompatible types
-
Hi everyone, I have this declaration:
Sub CreateTablePessoas(db As Database)
' Some code here
End SubAnd then this:
Sub CreateMyForm()
Dim db As Database
Dim tdf As TableDefSet db = CurrentDb() Set tdf = GetTable("Pessoas", db) If tdf Is Nothing Then CreateTablePessoas (db) End If
End Sub
But when calling CreateTablePessoas(db) I get error 13: incompatible types (I'm translating the error message from portuguese, so I'm not sure that's how it would display in english). I'm not much of a VBA guy, so what's the problem here? Thanks in advance.
Fratelli
-
Hi everyone, I have this declaration:
Sub CreateTablePessoas(db As Database)
' Some code here
End SubAnd then this:
Sub CreateMyForm()
Dim db As Database
Dim tdf As TableDefSet db = CurrentDb() Set tdf = GetTable("Pessoas", db) If tdf Is Nothing Then CreateTablePessoas (db) End If
End Sub
But when calling CreateTablePessoas(db) I get error 13: incompatible types (I'm translating the error message from portuguese, so I'm not sure that's how it would display in english). I'm not much of a VBA guy, so what's the problem here? Thanks in advance.
Fratelli
Got it:
Call CreateTablelPessoas(db)
Fratelli
-
Got it:
Call CreateTablelPessoas(db)
Fratelli
If you take out the brackets(parentheses) you should be able to manage without the
Call
as in:CreateTablelPessoas db
This one always used to catch me out too...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens