Macro in after update I didnt put there

Johnny

Registered User.
Local time
Today, 08:56
Joined
Mar 27, 2011
Messages
39
I have a form/subform based on a query. To search records and add new items from a combobox I placed an unbound combobox there then used the notinlist event to add new items, works fine.

But once the new item is added it doesnt refresh the form/subform. So I was going to requery the form in the after update event but the combox has a macro in there I didnt put there that has code in it based on my query. Select Record (, , First, ="[fldOTDate] = " & "#" & Format(Screen.ActiveControl,"mm/dd/yyyy") & "#"

Would I have to remove the macro, replace the code as VBA before I could use the after update event to add a requery command?

Or is there a way to requery using a macro, I have never used macros because everyone says its bad coding form so unfamiliar with the process.
 
Nevermind, found the macro conversion wizard.
 
...But once the new item is added it doesnt refresh the form/subform. So I was going to requery the form in the after update event...
So now you know how to convert the Macro to code, but it sounds as if you're talking about the Combobox not being 'refreshed,' which is to say not displaying the newly added item, in which case you need to Requery the Combobox itself, not the Form.

I don't run Access 2007 or 2011, but the Macro you "didn't put there" was the product of the Combobox Wizard, I suspect.

Linq ;0)>
 
Ahh well I requeried the form and it works but if this is a smoother solution I will use it, thanks!
 

Users who are viewing this thread

Back
Top Bottom