asather
Registered User.
- Local time
- Today, 14:19
- Joined
- Dec 31, 2007
- Messages
- 22
Does VBA not like hyphens in table names?
This works:
...But add a hyphen to the table name in the code and in the database....And it doesn't....
This works:
Public Sub myTest()
Dim v() As Variant
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim thistest As String
thistest = "tblMembershipFeeCategory"
rs.Open "SELECT * FROM " & thistest, CurrentProject.Connection, adOpenDynamic, adLockReadOnly
v = rs.GetRows
rs.Close
End Sub
...But add a hyphen to the table name in the code and in the database....And it doesn't....
Public Sub myTest()
Dim v() As Variant
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim thistest As String
thistest = "tblMembershipFee-Category"
rs.Open "SELECT * FROM " & thistest, CurrentProject.Connection, adOpenDynamic, adLockReadOnly
v = rs.GetRows
rs.Close
End Sub