Initial Combo Selection NOT Refreshing Subform(s)

M

Mike Sims

Hello, I have a form with a couple of combo boxes and two sub forms.
When a user types in a part number in the combo box, and hits enter, the
lower subform does not refresh. However, if they hit the down arrow,
and choose another part number, it refreshes just fine, and from that
point forward, it works great with every selected (or typed) part
number. It is only the first part number selection after opening the
main form that does not properly refresh the second subform.

Any ideas? Here is the combo AfterUpdate event if your interested (It
is the frmSubNonGuv subform that is problematic):

Private Sub ComboPartNum_AfterUpdate()

ComboPartNum.Value = UCase$(ComboPartNum.Value)
strSubLinkForm = "frmNonGuvQuotes"
strSubLinkData = "[PART_NUM] = '" & Me!ComboPartNum & "'"
strCombo = "PART_NUM"

frmSubGuv.Filter = "[PART_NUM] = '" & Me!ComboPartNum & "'"
frmSubNonGuv.Filter = "[PART_NUM] = '" & Me!ComboPartNum & "'"
frmSubGuv.FilterOn = True
frmSubNonGuv.FilterOn = True

End Sub
 
J

Jon

You could try an explicit requery, that should force it to update if it
refuses to do so on its own:

Private Sub ComboPartNum_AfterUpdate()

ComboPartNum.Value = UCase$(ComboPartNum.Value)
strSubLinkForm = "frmNonGuvQuotes"
strSubLinkData = "[PART_NUM] = '" & Me!ComboPartNum & "'"
strCombo = "PART_NUM"

frmSubGuv.Filter = "[PART_NUM] = '" & Me!ComboPartNum & "'"
frmSubNonGuv.Filter = "[PART_NUM] = '" & Me!ComboPartNum & "'"
frmSubGuv.FilterOn = True
frmSubNonGuv.FilterOn = True
Me.Requery
End Sub



Jon
 
M

Mike Sims

I tried all the refresh stuff - even tried refreshing each subform
individually.

Its an odd problem for sure.
 
J

Jon

What happens if you explicitly call a requery on the misbehaving subform?

Me.sfmMisbehaving.Form.Requery



That might be worth a try.



Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top