TravelingCat
Registered User.
- Local time
- Today, 17:08
- Joined
- Feb 22, 2010
- Messages
- 42
Hi,
I have a mainform, and a subform in it. The main form contains current event details. The subform has ListBox control which contains assignments of that event. To add a new assignment, you click on button and another form opens. The thing is, if the listbox already contains some assignments, the new one are added and shown without a problem. But if the listbox is still empty and i'm adding a first, it doesn't requery, only if i exit the form and reload it. I would really appreciate if someone could point me to the solution.
I also noticed that the same problem appears in my other listboxes as well.
Here's the code behind the "add new assignment" button:
I have a mainform, and a subform in it. The main form contains current event details. The subform has ListBox control which contains assignments of that event. To add a new assignment, you click on button and another form opens. The thing is, if the listbox already contains some assignments, the new one are added and shown without a problem. But if the listbox is still empty and i'm adding a first, it doesn't requery, only if i exit the form and reload it. I would really appreciate if someone could point me to the solution.
I also noticed that the same problem appears in my other listboxes as well.
Here's the code behind the "add new assignment" button:
Code:
Private Sub btnNewAssignment_Click()
Text = Forms(Parent.Name).Controls("eventNum")
strRow = ListAssignments.ListIndex + 1
strAssignNum = Nz(ListAssignments.Column(7))
DoCmd.OpenForm "frmNewAssignment", , , , acFormAdd, acDialog, 1 & ";" & Text
ListAssignments.Requery
End Sub