|
-
Nov 29th, 2000, 09:15 AM
#1
Thread Starter
Addicted Member
How can you return a value which shows if a recordset is open or closed?
Normal is boring...
 smh 
-
Nov 29th, 2000, 09:20 AM
#2
_______
<?>
To return a value from a recordset you must first create the recordset (Fill it with values)
off the top I think it's like this in dao
Dim sql as string
sql = "Select aField from yourTable"
data1.recordsource = sql
data1.refresh
to get the first record
data1.recordset.movefirst
myString = Data1.Recordset!yourfield
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 29th, 2000, 09:26 AM
#3
Thread Starter
Addicted Member
I don't think we were on the same line there, otherwise I am confused. I want to know if the recordset is open, not return a record. Here's my code:
________________________________________________
Private Sub cboBankName_click()
***Want to know if the recordset is already open here***
***If the recordset is open THEN
rst.close
end if
gstrHold = cboBankName.Text
rst.Open "SELECT Banks.*, BankFees.* " & _
"FROM BankFees INNER JOIN Banks ON BankFees.BankName = Banks.BankName " & _
"WHERE FeeEndDate is NULL " & _
"AND Banks.BankName = '" & gstrHold & "' ;", cnn, adOpenStatic, adLockOptimistic
'Predefined subroutine
FillBoxes
End Sub
Normal is boring...
 smh 
-
Nov 29th, 2000, 09:34 AM
#4
Fanatic Member
Check the "State" of the recordset.
If rsValidate.State = adStateOpen Then
' do whatever
End If
-
Nov 29th, 2000, 09:46 AM
#5
Thread Starter
Addicted Member
Thanks...Worked great.
smh
Normal is boring...
 smh 
-
Nov 29th, 2000, 10:05 AM
#6
Fanatic Member
Damn. Missed one of your threads - no more lunch for me...
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 29th, 2000, 10:08 AM
#7
Thread Starter
Addicted Member
You deserve lobster for dinner after yesterday...
smh
Normal is boring...
 smh 
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
|