Docmd.RunSQL with Like and Wild Card

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble with the where clause in the following statement. It
works when I created it using the Query builder but not when I use it in
runsql.

varSQL = "SELECT msysobjects.Name FROM msysobjects WHERE
(((msysobjects.Name) Like 'srtc_*') AND ((msysobjects.Type)=1))"

Set rstTables = New ADODB.Recordset
rstTables.CursorLocation = adUseClient
rstTables.Open varSQL, CurrentProject.Connection, adOpenStatic,
adLockOptimistic

Thanks for your help,

Jim
 
Duane,

The problem was there was no records in the query results. The % fixed the
problem... Thanks for the help...

Jim
 

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

Back
Top