473,672 Members | 2,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OpenRecordse t("SELECT * from tblFromCSV WHERE
[rsclaims]![Claim_Number] = "_
& strQuote & [rsCNumb]![Claim_Number] & strQuote & strQuote)

Debug.Print rsClaims.EOF
Thx

Kevin
Sep 12 '08 #1
7 1769
rkc
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATco mcastDOTnetwrot e:
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.OpenRecordse t("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.comw rote in
news:7f******** *************** ***********@x41 g2000hsb.google groups.com:
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATco mcastDOTnetwrot e:
>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.OpenRecordse t("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.com wrote innews:7f****** *************** *************@x 41g2000hsb.goog legroups.com:
On Sep 11, 9:35*pm, "KC-Mass" <connearneyATco mcastDOTnetwrot e:
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.OpenRecordse t("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.comw rote in
news:e8******** *************** ***********@d1g 2000hsg.googleg roups.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.com wrote innews:e8****** *************** *************@d 1g2000hsg.googl egroups.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.com wrote innews:e8****** *************** *************@d 1g2000hsg.googl egroups.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_Numb er" should be just that. The
"rsclaim!" piece got there through some inartful copy and paste.

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

Many thanks
Sep 12 '08 #7
rkc <rk*@rkcny.comw rote in
news:34******** *************** ***********@m3g 2000hsc.googleg roups.com:
Are you seriously puzzled?
Not with

Set rsClaims = db.OpenRecordse t("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
5890
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> <%=SkillType%>
4
1718
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
1454
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 - Number ListName - Text
3
1822
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 I am trying to build will not open. Can someone help me with this? Thanks for your help! Else 'Update ItemsTable record with new info Debug.Print ("attempting to open recordset") If Me.ItemID <> Null Then
2
12999
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' --no luck. I also did the following. verified that the types of var in the sql statement were the same. verified that the variables held values at the time the statement is
3
11554
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 can work with the returned records. In VB 6, I use DAO and do it this way: Dim db As Database Dim rs As Recordset Dim qd As QueryDef
2
1426
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 combo box, the text boxes on the form will be populated with the associated data. This is driving me insane! I've researched almost all day on this, and can't seem to find an answer. Any help would would be HUGELY appreciated as this is part of a...
1
1902
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 has a SQL statement in it's rowsource so it will only display distinct records in it's field where all the previous fields match the choices chosen in previous combo boxes, so eventually your choices will be narrowed down until you come up with a...
2
2775
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 ADODB.Recordset Dim recSet2 As ADODB.Recordset Set con1 = CurrentProject.Connection Set con2 = CurrentProject.Connection Set recSet1 = New ADODB.Recordset Set recSet2 = New ADODB.Recordset
0
8503
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8945
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8696
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6254
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2836
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2092
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1836
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.