requery stored procedure in Access form ?

qwertyjjj

Registered User.
Local time
Today, 07:27
Joined
Aug 8, 2006
Messages
262
We create a recordset that the form uses for its data.
When we select other records on a different form it does not refresh.
How can we requery the stored procedure in Access?
.Requery does not work on SQL stored procedures...

Thanks
 
I'm afraid you'll have to provide a little more information than this.

Requery the procedure?? Elaborate...
 
Err...
A form's data is brought into a recordset by running a stored procedure on the SQL server.
Pressing a button on another form or double clicking a data row is supposed to refresh the data on the original form but it doesn't because the stored rocedure is not rerun.

In Access you would usually run DoCmd.Requery but it doesn't do anything because it's a recordset.
SO, how d you refresh the recordset when the data is brought in from a stored procedure?
 
So, you want to save the recordset with the updates??

DoCmd.Save??
Maybe open the clone and .Update through it??

I am not familiar with SQL server, but it doesn't sound like that is the problem...
 
No, we just want to requery the database.To do this, it has to rerun the stored procedure and put it into a new recordset.
Because it's a stored procedure and the form was already open, there doesn't seem to be a way to refresh it.

Maybe some onEvent thing needs to have the call for the stored procedure put into it.

?
 
No, we just want to requery the database.
?????
To do this, it has to rerun the stored procedure and put it into a new recordset.
Put it into a newrecordset?? Put WHAT?? The old data? New data?
Because it's a stored procedure and the form was already open, there doesn't seem to be a way to refresh it.
Maybe this will help you get to where you're going....

* You can CALL a function by just typing it's name in the line of code you want (Call "functionname"). It should then cycle through its own code.

* To update a table's information when the table's form is open and active, loop through the records using the Me.Recordset Clone property of the form.

* When you say....
the form was already open, there doesn't seem to be a way to refresh it.
...define refresh. Do you want to see updated data?? What task is being done with the procedure that requires the form to be refreshed???
 
Hi
Yes, we want to see the new data.
So,
- the form is opened
- we run a stored procedure
- data is put into a recordset
- form recordset is set to the rst recordset
- another form opens
- user puts in data on this other form
- use closes form
- we now want to run the stored procedure again and put in new data except nothing seems to fire off the event to do this.

Shall I send through the form + code?
 
I don't think you can requery a stored procedure in same sense as you can do with a recordset. Rather, you want to execute the procedure again. Therefore, use same code you used to call for the stored procedure and paste it in appropriate event (a button onclick? AfterUpdate for first form?), then reset the form's recordset to the new recordset of re-run stored procedures.

This is all I can provide as I am not familiar with how you call stored procedures.
 

Users who are viewing this thread

Back
Top Bottom