473,509 Members | 3,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Recordset

Hi all,
I am new to access and I got a simple question
How can I display matching a row from a table?
I have:
Function test2()

Dim loDB As Database
Dim loRSPlayer As Recordset
Dim lnIndex As Integer
Dim lnCount As Integer
Set loDB = CurrentDb

Set loRSPlayer = loDB.OpenRecordset("HandGroup")
' add
With loRSPlayer
.FindFirst "Card1 = "
.Close

End With
End Function

It is complaining that object doesn't support this peration. I can add
new record with .AddNew (same dims). Can you help?

Thx

May 21 '06 #1
7 1946
pe****@syr.edu wrote in
news:11**********************@j55g2000cwa.googlegr oups.com:
Hi all,
I am new to access and I got a simple question
How can I display matching a row from a table?
You create a bound form. That may sound flippant, but the form
opens the recordset, transfers the field values to the controls
on the form.

If you want to emulate the process with an unbound form, you are
spending effort for nothing.

BTW, .FindFirst "Card1 = " is missing the value to find,
which may explain the error message

It should be .FindFirst "Card1 = " & somevariable 'if numeric
or .FindFirst "Card1 = """ & somevariable & """" 'if text
or .FindFirst "Card1 = $" & somevariable & "#" 'if datetime

I have:
Function test2()

Dim loDB As Database
Dim loRSPlayer As Recordset
Dim lnIndex As Integer
Dim lnCount As Integer
Set loDB = CurrentDb

Set loRSPlayer = loDB.OpenRecordset("HandGroup")
' add
With loRSPlayer
.FindFirst "Card1 = "
.Close

End With
End Function

It is complaining that object doesn't support this peration. I
can add new record with .AddNew (same dims). Can you help?

Thx


--
Bob Quintal

PA is y I've altered my email address.
May 21 '06 #2
I tried :

Function test2()

Dim loDB As Database
Dim loRSPlayer As Recordset
Dim lnIndex As Integer
Dim lnCount As Integer
Dim lsCard As String

lsCard = "K"
Set loDB = CurrentDb

Set loRSPlayer = loDB.OpenRecordset("HandGroup")
' add
With loRSPlayer
.FindFirst "Card1 = """ & lsCard & """"
.Close

End With
End Function

Still getting same error msg.

May 21 '06 #3
pe****@syr.edu wrote in news:1148238273.942390.95750
@j73g2000cwa.googlegroups.com:
I tried :

Function test2()

Dim loDB As Database
Dim loRSPlayer As Recordset
Dim lnIndex As Integer
Dim lnCount As Integer
Dim lsCard As String

lsCard = "K"
Set loDB = CurrentDb

Set loRSPlayer = loDB.OpenRecordset("HandGroup")
' add
With loRSPlayer
.FindFirst "Card1 = """ & lsCard & """"
.Close

End With
End Function

Still getting same error msg.


When you step through the code (using the F8 key), which line
triggers the error message?

--
Bob Quintal

PA is y I've altered my email address.
May 21 '06 #4
at ".FindFirst"

Thx for reply

May 21 '06 #5
I see no place where you do anything that would display the record, either
in this post or your follow-up. If you have a Form open that has its
RecordSource the same as the "HandGroup" (table or query) that you use here,
you could use its RecordsetClone to find the appropriate record, and set
Bookmarks to show that record on the form.

On your second response, that is still the case... you've done nothing to
display the Record, even if it did work to find it. Are you certain that the
Field is actually named Card1? Did you try enclosing the Card1 in square
brackets, e.g. "[Card1] = """...?

Larry Linson
Microsoft Access MVP
<pe****@syr.edu> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hi all,
I am new to access and I got a simple question
How can I display matching a row from a table?
I have:
Function test2()

Dim loDB As Database
Dim loRSPlayer As Recordset
Dim lnIndex As Integer
Dim lnCount As Integer
Set loDB = CurrentDb

Set loRSPlayer = loDB.OpenRecordset("HandGroup")
' add
With loRSPlayer
.FindFirst "Card1 = "
.Close

End With
End Function

It is complaining that object doesn't support this peration. I can add
new record with .AddNew (same dims). Can you help?

Thx

May 22 '06 #6
Yes, I have "Card1" field in "HandGroup" table. I have no idea why this
isn't working.
Yes I didn't code anything for "displaying", that's second thing in my
mind now :)
Would you show me how to do it

thx

May 22 '06 #7
Set loRSPlayer = loDB.OpenRecordset("HandGroup", dbOpenDynaset)

----
Would you tell us how you want to show it?
message box?
form?
report?
datasheet?
....
etched in blood on your desk?

How?

May 22 '06 #8

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

Similar topics

14
2922
by: Rahul Chatterjee | last post by:
Hello All I have an asp page in which I am performing the following 1. Querying a database view 2. Returning rows in to a recordset. 3. Looping thru the recordset and printing the data 4....
5
2056
by: Mystery | last post by:
Can anyone point me to a script that will allow me to list x number of records per page and give me a page selector and information like the one in the subject header? Thanks.
4
3970
by: Bryan | last post by:
I have a results table that is 5 columns wide. the recordset is returned with 48 items. I have no problem displaying 5 per row until I hit the last row where i get a ADODB.Field error '80020009' ...
2
1581
by: Steve Marciniak | last post by:
I'm trying to display different recordsets (which are 1 field each) as columns right next to one another. For example, Recordset1 is displayed on the left hand side of the screen. Recordset2 is...
6
1772
by: Jennifer Smith | last post by:
I want to be able to display my recordset as follows: a e b f c g d h Instead of : a b c d
2
1907
by: Greg Bale | last post by:
Hi. (this is s repeat post from MS community newsgroup) I am building a form for people to use to analyse the data in my Access2000 database. The SQL is built up in VBA depending on control...
2
4523
by: Dan | last post by:
I have a form which allows the user to select various options, which options I then use to dynamically generate a query into the database. I then want to display this query to the user. However,...
2
1309
by: t | last post by:
Hi, I have the following problem. The web-based software I am to create is going to display tabular data. Lots of data so I need some pagging mechanism. I thought about creating three classes:...
4
2494
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
7
5408
by: EManning | last post by:
I'm using A2003 connected to a SQL 2000 backend. This is not an adp. I have a table which I store 0 and -1 for 2 bit fields. I have a listbox on a form based on a query of this table. The...
1
7073
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
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
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...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
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 ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
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...

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.