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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange behavior in opening recordset

Status
Not open for further replies.

DerFarm

Programmer
Mar 10, 2003
25
Code:
  strTemp0 = "Matched-Field1" 'Left$("Matched-" & DepVar, 60)
  Results_RC.Open TargetResults, Conn, adOpenKeyset, adLockPessimistic, adCmdTable
  
 Dep_RC.Open "Matched-Field1", Conn, adOpenKeyset, adLockPessimistic, adCmdTable

in the above code snippet, Results_RC works fine. Dep_RC doesn't.

TargetResults is string variable
strTemp0 is = "Matched-Field1"

I've tried the variable strTemp0 and the hardwired string

Both give the error: Syntax error in From Syntax

I've reversed the order of the opening of the recordsets, same error. The table Matched-Field1 IS in the targetdatabase pointed to by the connection string

What stupid thing am I doing?



 
Just a guess, but maybe it doesn't like the hyphen? Try "[Matched-Field1]".
 
Bingo!

I've been careful about that up to this point, but ...


Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top