J
jhanby1
So I have 2 separate forms: [Filter Detail] and [Add Part].
On [Filter Detail], there is a list box that displays a list of parts
for a particular filter. When I click on the Add Part command button,
the [Add Part] form opens up.
On [Add Part], I enter in the information for that particular part,
click the Add and Close command button, and requery the list box of
parts on [Filter Detail]. Here is my code for [Filter Detail]:
Private Sub cmdAddPart_Click()
setUIUpdateVars
DoCmd.OpenForm "Add Part", acNormal, , , , , "ADD:" &
Me.txtFilterId & ":"
Me.cboGroup = Null
setPartGroup ("All")
refreshData
Me!cboGroup.Requery
End Sub
Public Function refreshData()
calcFilterTotal
If (IsNull(Me!cboGroup.Column(0))) Then
setPartGroup ("All")
Else
setPartGroup (Me!cboGroup.Column(0))
End If
Me!lstParts.Requery
End Function
Here is code from [Add Part]:
Private Sub cmdAddClose_Click()
If canAddPart Then
addPart
DoCmd.Close acForm, "Add Part"
End If
End Sub
Don't worry about the other functions you see in the code
(setPartGroup, calcFilterTotal, canAddPart, addPart), they shouldn't
affect my problem. I tried commenting them out to see if it they were
tripping up the process, and no luck, so there is something else I am
missing. After the part is added from the [Add Part] form, the listbox
does not show the addition until I click a refresh button. I want the
listbox to immediately show the change once the [Add Part] form is
closed.
Thanks for the help.
On [Filter Detail], there is a list box that displays a list of parts
for a particular filter. When I click on the Add Part command button,
the [Add Part] form opens up.
On [Add Part], I enter in the information for that particular part,
click the Add and Close command button, and requery the list box of
parts on [Filter Detail]. Here is my code for [Filter Detail]:
Private Sub cmdAddPart_Click()
setUIUpdateVars
DoCmd.OpenForm "Add Part", acNormal, , , , , "ADD:" &
Me.txtFilterId & ":"
Me.cboGroup = Null
setPartGroup ("All")
refreshData
Me!cboGroup.Requery
End Sub
Public Function refreshData()
calcFilterTotal
If (IsNull(Me!cboGroup.Column(0))) Then
setPartGroup ("All")
Else
setPartGroup (Me!cboGroup.Column(0))
End If
Me!lstParts.Requery
End Function
Here is code from [Add Part]:
Private Sub cmdAddClose_Click()
If canAddPart Then
addPart
DoCmd.Close acForm, "Add Part"
End If
End Sub
Don't worry about the other functions you see in the code
(setPartGroup, calcFilterTotal, canAddPart, addPart), they shouldn't
affect my problem. I tried commenting them out to see if it they were
tripping up the process, and no luck, so there is something else I am
missing. After the part is added from the [Add Part] form, the listbox
does not show the addition until I click a refresh button. I want the
listbox to immediately show the change once the [Add Part] form is
closed.
Thanks for the help.