Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Ado Data RDS > recordset of ac...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 253 of 305
Post > Topic >>

recordset of active connection

by =?Utf-8?B?amFuZXRi?= <janetb@[EMAIL PROTECTED] > Jun 3, 2005 at 12:15 PM

I'm brand new to recordsets in code, so chuckle all you want.  I'm trying
to 
open a recordset by executing some sql, iterate through two records or no 
records in code using the existing connection when something takes place
on a 
form (afterUpdate).  I was hoping I didn't have to create a new instance
of 
connection?  But, obviously don't know what I'm doing.  Any help?  Many 
thanks.

Dim varSql As String
Dim myErr As Integer
Dim adoRS As New ADODB.Recordset

varSql = "SELECT top 2 [maximum] as myMax FROM tblAbsentee ORDER BY 
[maximum] DESC where [subLotID]=" & Me.subLotID.Value

adoRS = DoCmd.RunSQL varSql


if adoRS.EOF then
   myErr=1
else
  myErr = 0
end if
Do While Not adoRS.EOF
    If Me.maximum < adoRS.Fields("myMax").Value Then
        myErr = myErr+1
    End If
    adoRS.MoveNext
Loop
adoRS.Close
Set adoRS = Nothing
Results = msgBox(myErr, vbOKOnly, "My results")
 




 2 Posts in Topic:
recordset of active connection
=?Utf-8?B?amFuZXRi?= <  2005-06-03 12:15:13 
RE: recordset of active connection
"=?Utf-8?B?UmljayBGZ  2005-06-09 14:49:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:19:21 CST 2008.