|
-
Aug 23rd, 2007, 02:49 PM
#1
Thread Starter
Fanatic Member
Question about stored procedures
Hi,
I have a stored procedure which select various values from 3 tables using inner joins
now my question is I have to display these values via a form using unbound
controls now instead of writing
rsset!quoteref = me.quoterefid etc etc...is there any quicker way of getting
these values displayed!!
Hope this is clear!
secondly = can i return all values from a SP and use the record selector of
a MSaccess form to scroll through the recordset or do I have to create
2 new buttons previous and next record?
thanks
** HOLLY ** 
-
Aug 23rd, 2007, 02:57 PM
#2
Fanatic Member
Re: Question about stored procedures
Firstly, you won't be able to scroll through your records if they are unbound unless you are going to code all the Next/Previous etc buttons to navigate your recordset.
And to your first question, No.
-
Aug 23rd, 2007, 03:08 PM
#3
Thread Starter
Fanatic Member
Re: Question about stored procedures
Hi..I thought the answer would be something of that nature...so it is exaclty
what i have done..but when I try to move to the previous record I receive
an error' object cannot be used in this context' have you any ideas?
Code:
private sub movenextRec()
If GEdibass.state = adstateclosed then
openconnection
else
rsset.moveprevious
end if
end sub
thanks
** HOLLY ** 
-
Aug 23rd, 2007, 04:12 PM
#4
Fanatic Member
Re: Question about stored procedures
Well your going to want to test to make sure your not already at the beginning of your recordset. What language and Objects are you using? It could be your OpenConnection is failing.
Code:
If Not rs.BOF Then
rs.MovePrevious
End If
-
Aug 24th, 2007, 04:43 AM
#5
Thread Starter
Fanatic Member
Re: Question about stored procedures
I'm using VBA the code I have is
Code:
Private Sub Command140_Click()
On Error GoTo Err_Command140_Click
If gEDIBass.State = adStateClosed Then
CreateConnection
Else
rsSet.MovePrevious
If Not rsSet.BOF = trueThen
loadvalues
Else
MsgBox ("Already at the first record"), vbCritical
End If
End If
Exit_Command140_Click:
Exit Sub
Err_Command140_Click:
MsgBox Err.Description
Resume Exit_Command140_Click
Resume
End Sub
and it fails with an error on the rsset.moveprevious
Anyone!!!
** HOLLY ** 
-
Aug 24th, 2007, 11:39 AM
#6
Fanatic Member
Re: Question about stored procedures
Is your recordset ADO?
http://www.w3schools.com/ado/met_rs_movefirst.asp
Not sure if it is supported in DAO (which is what Access uses by default).
So it should work if...
A)Connection is open
B)Recordset is loaded
C)Recordset is not BOF or EOF
-
Aug 25th, 2007, 02:38 PM
#7
Thread Starter
Fanatic Member
Re: Question about stored procedures
The recordset is open for the live of the form, I'm using ado and the recordset
is not at the EOF or BOF as the recordset contains 145 records....
plus it still does not work and I'm still rceiving the error!!
** HOLLY ** 
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
|