J
Jason
Hello all,
I have an Access 2003 ADP main form/sub form. The main form is bound
to an Invoice table and has an unbound text box name txtAddItem. The
subform has an sql statement for a record source that shows the
related line items to the invoice. If a user types in an ItemID into
the box txtAddItem it inserts a new record into the line items table
via a stored procedure that is executed in VBA code. Now after that I
requery the subform so it shows the newly inserted record.
All this works great, my problem is that the requery leaves the focus
in the subform and no matter what I do I can not move the focus back
to txtAddItem in the main form. Below is a snippit of the code that
does the requery and attempts to change the focus. The code is in the
main form's class module.
Private Sub txtAddNewItem_AfterUpdate()
Me.dbo_tblInvoiceLineItemsSubform.Requery
Me.txtAddNewItem = ""
Me.txtAddNewItem.SetFocus
end sub
Can anyone guide me on how to move the focus back to the main form
after the the requery of the subform?
Thanks,
Jason
I have an Access 2003 ADP main form/sub form. The main form is bound
to an Invoice table and has an unbound text box name txtAddItem. The
subform has an sql statement for a record source that shows the
related line items to the invoice. If a user types in an ItemID into
the box txtAddItem it inserts a new record into the line items table
via a stored procedure that is executed in VBA code. Now after that I
requery the subform so it shows the newly inserted record.
All this works great, my problem is that the requery leaves the focus
in the subform and no matter what I do I can not move the focus back
to txtAddItem in the main form. Below is a snippit of the code that
does the requery and attempts to change the focus. The code is in the
main form's class module.
Private Sub txtAddNewItem_AfterUpdate()
Me.dbo_tblInvoiceLineItemsSubform.Requery
Me.txtAddNewItem = ""
Me.txtAddNewItem.SetFocus
end sub
Can anyone guide me on how to move the focus back to the main form
after the the requery of the subform?
Thanks,
Jason