|
-
Jun 17th, 1999, 10:59 PM
#1
Thread Starter
New Member
First off, I apoligize if this is a stupid question, but I've racked my brain, and I'm at a loss. Did I mention I'm a beginner with VB? Here's what I want to do:
From my DB, I would like to select the records that contain the lowest 4 field values:
score name
10 BOB
11 ROB
33 SLOB
60 KNOB
90 MOB
22 MELVIN
From this, I want it to select the records that contain 10,11,22,33, HOW??????PLEASE HELP!!
------------------
-
Jun 18th, 1999, 12:37 AM
#2
Thread Starter
New Member
Thank you Dennis, your help is greatly appreciated!
------------------
-
Jun 18th, 1999, 11:38 AM
#3
New Member
Create a SQL query to open your recordset with the following syntax:
"SELECT TOP 4 tblWhatever.* FROM tblWhatever ORDER BY tblWhatever.Score DESC;"
In Access it will look like this:
Dim db as Database
Dim rst as Recordset
Dim strSql as String
strSql = "SELECT TOP 4 tblWhatever.* FROM tblWhatever ORDER BY tblWhatever.Score DESC;"
Set db = currentDb()
Set rst = db.openRecordset(strSql, dbOpenDynaset)
'do whatever you want from here.
rst.close
set rst = nothing
db.close
set db = nothing
Dennis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|