Re: Requery after you modify the SQL statement in VBA Access?

  • Thread starter Thread starter JHB
  • Start date Start date
J

JHB

Have you tried
Have you tried Me.Requery (not DoCmd.Requery) after Me.RecordSource = "Query"?

Here some note from the Help file.

The Requery method of the DoCmd object is different from the Requery method in Visual Basic. The Requery method of the DoCmd object was added to provide backwards compatibility for running the Requery action in Visual Basic code in Microsoft Access 95. If you want to requery a control that's not on the active object, you must use the Requery method in Visual Basic, not the Requery action or its corresponding Requery method of the DoCmd object. The Requery method of a form or control in Visual Basic is faster than the Requery action or the DoCmd.Requery method. In addition, when you use the Requery action or the DoCmd.Requery method, Microsoft Access closes the query and reloads it from the database, but when you use the Requery method, Microsoft Access reruns the query without closing and reloading it.

Else I'll suggest, set the Me.RecordSource to a zero string in the top of you procedure.

Me.RecordSource = ""



Regards

Jørn
 
Back
Top