0
votes

I have a form, that is bound to a query. There are sveral condition on filtering the record and one of them is list box where I can select conrete values. I have a macro, that insert IN() statement into the SQL with selected values and the query results working properly and is showing the correct records.. Never the less when I use form.requery it still shows all of the items and it is not showing the results from query). When I change other filters (for example in combobox) then the form requery correctly although both of the changes launch the same macro...

2
Changing the RecordSource will always requery a bound form. So, something else is going on.Gustav
Yeah, but I am not sure what... because when changing combobox the form requery, when doubleclick on listbox nothing happend in the form, but query shows good results... but even if I refresh form, or requery it from immediate window in VBA then it will not show the results from query...Cetriolo

2 Answers

0
votes

I finally found a solution :) I Just put Me.RecordSource = Me.RecordSource :)

0
votes

If your recordset is bound to the form just use

Me.Requery

If it is on your form within a form (subform) then use

Me!SubFormName.Form.Requery

If your form is not bound to a recordset/query you need to set the SQL string again.