473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Question on opening query to new recordset

I have a module that walks down a file of unique claim numbers. Db is
Current db.

For each claim number I want it to retrieve, to a recordset all the
transactions related to that claim.

The Set process for the recordset is obviously wrong. I get an error of "
At least one parameter expected" Any ideas on fixing the query text.
strQuote = Chr$(34)

Set rsClaims = db.OpenRecordset("SELECT * from tblFromCSV WHERE
[rsclaims]![Claim_Number] = "_
& strQuote & [rsCNumb]![Claim_Number] & strQuote & strQuote)

Debug.Print rsClaims.EOF
Thx

Kevin
Sep 12 '08 #1
7 1757
rkc
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATcomcastDOTnetwrote:
I have a module that walks down a file of unique claim numbers. *Db is
Current db.

For each claim number I want it to retrieve, to a recordset all the
transactions related to that claim.

The Set process for the recordset is obviously wrong. *I get an error of "
At least one parameter expected" Any ideas on fixing the query text.
strQuote = Chr$(34)

*Set rsClaims = db.OpenRecordset("SELECT * from tblFromCSV WHERE
[rsclaims]![Claim_Number] = * "_
* * * & strQuote & [rsCNumb]![Claim_Number] & strQuote & strQuote)

* * * * Debug.Print rsClaims.EOF
If this kind of thing baffles you on a regular basis try writing a
test.

Sub wtf()
Dim strQuote As String
strQuote = Chr$(34)
Dim s
'stand in for [rsCNumb]![Claim_Number]
Dim p As String
p = "12321"

' shows stray quote at end of string
s = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number] =
" _
& strQuote & p & strQuote & strQuote

' looks better to me
's = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number] = "
& strQuote & p & strQuote

Debug.Print s
End Sub


Sep 12 '08 #2
rkc <rk*@rkcny.comwrote in
news:7f**********************************@x41g2000 hsb.googlegroups.com:
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATcomcastDOTnetwrote:
>I have a module that walks down a file of unique claim numbers. *Db
is Current db.

For each claim number I want it to retrieve, to a recordset all the
transactions related to that claim.

The Set process for the recordset is obviously wrong. *I get an error
o
f "
>At least one parameter expected" Any ideas on fixing the query text.
strQuote = Chr$(34)

*Set rsClaims = db.OpenRecordset("SELECT * from tblFromCSV WHERE
[rsclaims]![Claim_Number] = * "_
* * * & strQuote & [rsCNumb]![Claim_Number] & strQuote & strQuote)

* * * * Debug.Print rsClaims.EOF

If this kind of thing baffles you on a regular basis try writing a
test.

Sub wtf()
Dim strQuote As String
strQuote = Chr$(34)
Dim s
'stand in for [rsCNumb]![Claim_Number]
Dim p As String
p = "12321"

' shows stray quote at end of string
s = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number] " _
& strQuote & p & strQuote & strQuote

' looks better to me
's = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number] = "
& strQuote & p & strQuote

Debug.Print s
End Sub
To further confuse things we might use single quotes in sql strings?

SELECT *
FROM Employees
WHERE [Last Name] = 'Cencini'
(north winds 2007)

so
s = "SELECT * from tblFromCSV
WHERE [rsclaims]![Claim_Number] = '" & p & "'"

but I'm puzzled by [rsclaims]![Claim_Number] in a query string.

Maybe I'm not getting the substance of this thread.

--
-
lyle fairfield
Sep 12 '08 #3
rkc
On Sep 12, 9:27*am, lyle fairfield <lylef...@yah00.cawrote:
rkc <r...@rkcny.comwrote innews:7f**********************************@x41g20 00hsb.googlegroups.com:
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATcomcastDOTnetwrote:
I have a module that walks down a file of unique claim numbers. *Db
is Current db.
For each claim number I want it to retrieve, to a recordset all the
transactions related to that claim.
The Set process for the recordset is obviously wrong. *I get an error
o
f "
At least one parameter expected" Any ideas on fixing the query text.
strQuote = Chr$(34)
*Set rsClaims = db.OpenRecordset("SELECT * from tblFromCSV WHERE
[rsclaims]![Claim_Number] = * "_
* * * & strQuote & [rsCNumb]![Claim_Number] & strQuote & strQuote)
* * * * Debug.Print rsClaims.EOF
If this kind of thing baffles you on a regular basis try writing a
test.
Sub wtf()
* * Dim strQuote As String
* * strQuote = Chr$(34)
* * Dim s
* * 'stand in for [rsCNumb]![Claim_Number]
* * Dim p As String
* * p = "12321"
* *' shows stray quote at end of string
* *s = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number] " _
* * * * *& strQuote & p & strQuote & strQuote
* ' looks better to me
* *'s = "SELECT * from tblFromCSV WHERE [rsclaims]![Claim_Number]= "
& strQuote & p & strQuote
* Debug.Print s
End Sub

To further confuse things we might use single quotes in sql strings?

SELECT *
FROM Employees
WHERE [Last Name] = 'Cencini'
(north winds 2007)

so
s = "SELECT * from tblFromCSV
WHERE [rsclaims]![Claim_Number] = '" & p & "'"

but I'm puzzled by [rsclaims]![Claim_Number] in a query string.

Maybe I'm not getting the substance of this thread.

--
-
lyle fairfield
I interpreted [rsclaims]![Claim_Number] as a field from a second
recordset.
Sep 12 '08 #4
rkc <rk*@rkcny.comwrote in
news:e8**********************************@d1g2000h sg.googlegroups.com:
I interpreted [rsclaims]![Claim_Number] as a field from a second
recordset.
Now I'm more puzzled.

A query string can reference a recordset!field?
--
-
lyle fairfield
Sep 12 '08 #5
rkc
On Sep 12, 11:12*am, lyle fairfield <lylef...@yah00.cawrote:
rkc <r...@rkcny.comwrote innews:e8**********************************@d1g200 0hsg.googlegroups.com:
I interpreted *[rsclaims]![Claim_Number] as a field from a second
recordset.

Now I'm more puzzled.

A query string can reference a recordset!field?
Are you seriously puzzled?

The op was building a string using the value of a field from a
recordset.
Sep 12 '08 #6
On Sep 12, 11:12*am, lyle fairfield <lylef...@yah00.cawrote:
rkc <r...@rkcny.comwrote innews:e8**********************************@d1g200 0hsg.googlegroups.com:
I interpreted *[rsclaims]![Claim_Number] as a field from a second
recordset.

Now I'm more puzzled.

Aquerystring can reference a recordset!field?
--
-
lyle fairfield
The reference to the "Claim_Number" should be just that. The
"rsclaim!" piece got there through some inartful copy and paste.

I now have it working as Set rsClaims = db.OpenRecordset("SELECT *
from tblFromCSV WHERE Claim_Number = " & strQuote & rsCNumb!
Claim_Number & strQuote)

Many thanks
Sep 12 '08 #7
rkc <rk*@rkcny.comwrote in
news:34**********************************@m3g2000h sc.googlegroups.com:
Are you seriously puzzled?
Not with

Set rsClaims = db.OpenRecordset("SELECT *
from tblFromCSV WHERE Claim_Number = " & strQuote & rsCNumb!
Claim_Number & strQuote)

which the op (maybe ... he used a different nick but I think the op)

just posted.

--
-
lyle fairfield
Sep 12 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Bo | last post by:
Hi, I have a drop down menu that is being populated by a query to the access database ---- Code --- Skill needed <SELECT size="1" NAME="SkillType" VALUE="SkillType"> <OPTION>...
4
by: cwhite | last post by:
Hi I have another drop list question. I have a table like this: computer dell computer ibm computer hp
2
by: JP SIngh | last post by:
Hi All I have threee tables like the one below and i would like to ask if it is possible to display the data from all three tables using a single recordset in ASP. TABLE - tblList id -...
3
by: JB | last post by:
Hello, I am trying to write a query that selects a row from another table with a field that matches the Me!RecordingID that's on the form. For some reason my query is not working and the recordset...
2
by: JB | last post by:
Thanks to both of you for responding. To Pieter: The second asterisk actually isn't there. The original code reads just as you suggested it should. To Phil: I tried changing the 'And' to 'and'...
3
by: eagleofjade | last post by:
I am trying to help a friend who is learning VB.net in school. I have done VB programming for a number of years using VB 6. He needs to open a query in an Access database that has parameters so he...
2
by: airman_30 | last post by:
i am opening a recordset in my VB code and populating a combo box with the data from one of the fields in my recordset. I want to set it up so that, when a user selects one of the values from the...
1
by: omar.norton | last post by:
I am trying to create a from with a series of combo boxes that each query a different field (called Specific01, Specific02 etc., except the first field which is called Condition). Each combo box...
2
by: Kosmos | last post by:
I am opening the following connections as such although I am only referring to the first connection for this question: Dim con1 As ADODB.Connection Dim con2 As ADODB.Connection Dim recSet1 As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.