My Assistant
![]() ![]() |
|
|
May 30 2005, 06:02 AM
Post
#1
|
|
|
New Member Posts: 18 |
Hi,
I am attempting to use the following code: Set recSource = CurrentDb().OpenRecordset("select * from qryCut_Over_Details where " & _ "[loop] = '" & strLoop & "'") The problem is that it only returns a recordsource with a recordcount = 1 even tough if I build a query with the same SQL string I get a list of 50 odd entries. Why would the VB code only return a single entry? Thanks Roger Warne |
|
|
|
May 30 2005, 06:11 AM
Post
#2
|
|
|
New Member Posts: 18 |
I added a ORDER BY [loop] and it works!
Thanks all |
|
|
|
May 30 2005, 06:12 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 7,232 From: Belgium |
Best is to do this in steps
Dim Db as dao.database Dim rs as dao.recordsource SQLString = "select * from qryCut_Over_Details where " & "[loop] = '" & strLoop & "'" Debug.print SQLString Set db= currentdb() Set rs = db.openrecordset(SQLString) By using the debug.print line, you can see the contents of the SQL-string in the immediate window I use also single quotes around the textvalue HTH Greetz from Belgium (IMG:http://www.utteraccess.com/forum/style_emoticons/default/compute.gif) Luc aka Kuifjexx |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th May 2013 - 12:53 PM |