Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem opening a recordset with a variable name

Status
Not open for further replies.

Felix18807

Programmer
Jun 24, 2011
39
GB
RS.Open Me.txtTableName.Value, CurrentProject.Connection, adOpenKeyset, adLockOptimistic

Where txtTableName is a textbox on a form returns this error -2147217900

Does anyone know a fix for this?
 

hi,

how about...
Code:
RS.Open Me.txtTableName.Value, CurrentProject.Connection, adOpenKeyset, adLockOptimistic[b], adCmdTable[/b]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
RS.Open Me.txtTableName.Text, CurrentProject.Connection, adOpenKeyset, adLockOptimistic

or

MyTableName = Me.txtTableName.Text
RS.Open MyTablename, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top