Updating subforms not working

  • Follow


main form has a dropdown combot box selecting query values which updates a 
record on main form.
Subform being dispaly references this value to display records from a second 
table.

But when I select a value the subform doesn't change.
but then I noticed that the sub form is one value behind, not always. 
select employee but emolpyee detail records don't update.
select another employee and last employee records gets displayed.

private sub cbEmployee_Change()
  docmd.Save
  Me.EmployeeDetails.Requery
end sub
 
butthis doesn't seem to work.
0
Reply Utf 1/8/2010 11:18:01 PM

Try replacing the Change event with the AfterUpdate event (Change fires with 
each keystroke) and replace:

docmd.Save

Me.Dirty = False
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Shawn" <Shawn@discussions.microsoft.com> wrote in message 
news:57D433B2-DC20-4D5C-9085-91EC138B8F88@microsoft.com...
> main form has a dropdown combot box selecting query values which updates a
> record on main form.
> Subform being dispaly references this value to display records from a 
> second
> table.
>
> But when I select a value the subform doesn't change.
> but then I noticed that the sub form is one value behind, not always.
> select employee but emolpyee detail records don't update.
> select another employee and last employee records gets displayed.
>
> private sub cbEmployee_Change()
>  docmd.Save
>  Me.EmployeeDetails.Requery
> end sub
>
> butthis doesn't seem to work. 


0
Reply Arvin 1/9/2010 2:45:11 AM


ok that works.

Thanks.

"Arvin Meyer [MVP]" wrote:

> Try replacing the Change event with the AfterUpdate event (Change fires with 
> each keystroke) and replace:
> 
> docmd.Save
> 
> Me.Dirty = False
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
> 
> 
> "Shawn" <Shawn@discussions.microsoft.com> wrote in message 
> news:57D433B2-DC20-4D5C-9085-91EC138B8F88@microsoft.com...
> > main form has a dropdown combot box selecting query values which updates a
> > record on main form.
> > Subform being dispaly references this value to display records from a 
> > second
> > table.
> >
> > But when I select a value the subform doesn't change.
> > but then I noticed that the sub form is one value behind, not always.
> > select employee but emolpyee detail records don't update.
> > select another employee and last employee records gets displayed.
> >
> > private sub cbEmployee_Change()
> >  docmd.Save
> >  Me.EmployeeDetails.Requery
> > end sub
> >
> > butthis doesn't seem to work. 
> 
> 
> .
> 
0
Reply Utf 1/9/2010 7:53:01 AM

2 Replies
851 Views

(page loaded in 0.045 seconds)

Similiar Articles:
















7/18/2012 4:44:40 PM


Reply: