question

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 asked erinding-msft edited

Issue to table name

Hi,
Why is there error
93922-1j.png
due to this line

Set rs = db.openrecordset("select * from " & ActiveSheet.Name & ";")

while ActiveSheet.Name is having value like "Week8-13"?


office-vba-devoffice-access-dev
1j.png (7.5 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Is this an Access or Excel code, and what is db?


0 Votes 0 ·

@Jackson1990-7147
As your issue is more related to code, and tag "office-excel-itpro" focuses on general issues about Excel client, I will remove it.
Thanks for your understanding.

0 Votes 0 ·
OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

If the sheet name includes some non alphabetical characters you have to set it in square bracket [ ]; better set it always in brackets
=>

 Set rs = db.openrecordset("select * from [" & ActiveSheet.Name & "];")
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered Viorel-1 commented

Sorry, II still have same error using line below

Set rs = db.openrecordset("select * from [" & ActiveSheet.Name & "];")

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Does your Access database include a table, which is called “Week8-13”?

0 Votes 0 ·
Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered

Does your Access database include a table, which is called “Week8-13”?

Yes


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

This thread may be related to this other one.

issue-to-code-1.html


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.