run-time error 2501

J

Jeff Klein

I am receiving run-time error 2501. The code that is producing this is:

Private Sub Get_Data()

str_EmployeeName = cbo_EmployeeName.Value
str_ClientName = cbo_ClientName.Value
'copies the query data into a table
DoCmd.RunSQL "SELECT * INTO [tbl_TempCalendarData] FROM
[qry_Union_Single_Weekly_Monthly];"
End Sub

I can not figure out what is causing this!! Maybe there is a better way to
populate a table.. Any ideas??
 
T

tina

if you paste that SQL statement into the SQL pane of a new query -as is -
and run the query, does it work?

hth
 
J

Jeff Klein

Yes...in fact this code works intermittently.


tina said:
if you paste that SQL statement into the SQL pane of a new query -as is -
and run the query, does it work?

hth


Jeff Klein said:
I am receiving run-time error 2501. The code that is producing this is:

Private Sub Get_Data()

str_EmployeeName = cbo_EmployeeName.Value
str_ClientName = cbo_ClientName.Value
'copies the query data into a table
DoCmd.RunSQL "SELECT * INTO [tbl_TempCalendarData] FROM
[qry_Union_Single_Weekly_Monthly];"
End Sub

I can not figure out what is causing this!! Maybe there is a better way to
populate a table.. Any ideas??
 
T

tina

well, it probably has to do with the specific circumstances in place each
time you call the sub in your code. where are you calling Get_Data() from?
and how about posting the "text" of error 2501 - it's a common error, but i
don't keep those things at the top of my mind.

hth


Jeff Klein said:
Yes...in fact this code works intermittently.


tina said:
if you paste that SQL statement into the SQL pane of a new query -as is -
and run the query, does it work?

hth


Jeff Klein said:
I am receiving run-time error 2501. The code that is producing this is:

Private Sub Get_Data()

str_EmployeeName = cbo_EmployeeName.Value
str_ClientName = cbo_ClientName.Value
'copies the query data into a table
DoCmd.RunSQL "SELECT * INTO [tbl_TempCalendarData] FROM
[qry_Union_Single_Weekly_Monthly];"
End Sub

I can not figure out what is causing this!! Maybe there is a better
way
to
populate a table.. Any ideas??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top