Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery Problem

Status
Not open for further replies.

Krystoff

MIS
Sep 18, 2002
129
US
Hi all, I have a wierd problem where on the current event of a subform it goes out and sets the value of a Parameter for the main form and then requeries the main form.

However, it jumps into a wierd loop. It keeps going back to the same procedure again and again. Here is my code.

****************************
Private Sub Form_Current()
On Error GoTo Err_Form_Current

Forms!Data_entry!GetCustID = Me.CustID
Forms!Data_entry.Requery


Exit_Form_Current:
Exit Sub

Err_Form_Current:
MsgBox Err.Description
Resume Exit_Form_Current
End Sub
******************

Any help is appreciated
 
If you requery in form current, it fires a form current.

So don't do that.

 
How can I get my form to refresh without refreshing the subform?

The subform is the form that has the On Current event.

Is there any way to exclude the subform from the requery?

The subform isn't bound in any way to the main form except as a control.

This was working earlier when my subform was based off of a SQLSTR. I changed it to a Stored Procedure so I could use Variables.

Any suggestions?
 
I can't image that you ever got a FormCurrent event with a me.requery in it to work... unless the requery wasn't doing anything and therefore not causing a second FormCurrent.

The best tactic is to try to find another event procedure in which to requery your form.

FYI:
requery retrieves information from the tables, updating the form.

refresh updates tables with data in the form.

perhaps you want to use refresh instead of requery?
 
No unfortunately Refresh does the same thing. Puts it into a loop.

It wasn't a Forms Current event, it was the subforms current event.

Ill keep looking for a solution.

Thanks for the help Beetee!

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top