K
Kelii
I've been trying to find an answer to this question in the groups all
day without luck.
So here is my situation:
I have a form (frmA) that has a button (cmdA) for calling another form
(frmB) which consists of a subform (sbfB) which displays a Pivot
Chart. When my code executes, a value from frmA is passed to an
unbound combo box control on frmB which in turn drives the query
behind the Pivot Chart sbfB.
The problem:
The Pivot Chart sbfB does not update (i.e., it shows no data
whatsoever). When I step through the code, sbfB goes through the load
procedure properly. However, when the combo box value on frmB is
updated, the associated After Update procedure does not execute.
Furthermore, my effort to requery the form seems to have on impact.
Note: sbfB works perfectly when opened independently by the user
(i.e., not via code).
Any help on how to get sbfB to refresh using code would be dearly
helpful.
Best,
Kelii
Here is my code:
Private Sub cmdA_Click()
On Error GoTo Error_Handler
DoCmd.OpenForm "frmB"
Forms![frmB]![cboControl] = (Me.ValueFromFormA)
Forms![frmB]![sbfB].Form.Requery
Exit_Procedure:
On Error Resume Next
Exit Sub
Error_Handler:
Select Case Err
Case Else
MsgBox "Error: " & Err.Number & vbCr & Err.Description
Resume Exit_Procedure
End Select
End Sub
day without luck.
So here is my situation:
I have a form (frmA) that has a button (cmdA) for calling another form
(frmB) which consists of a subform (sbfB) which displays a Pivot
Chart. When my code executes, a value from frmA is passed to an
unbound combo box control on frmB which in turn drives the query
behind the Pivot Chart sbfB.
The problem:
The Pivot Chart sbfB does not update (i.e., it shows no data
whatsoever). When I step through the code, sbfB goes through the load
procedure properly. However, when the combo box value on frmB is
updated, the associated After Update procedure does not execute.
Furthermore, my effort to requery the form seems to have on impact.
Note: sbfB works perfectly when opened independently by the user
(i.e., not via code).
Any help on how to get sbfB to refresh using code would be dearly
helpful.
Best,
Kelii
Here is my code:
Private Sub cmdA_Click()
On Error GoTo Error_Handler
DoCmd.OpenForm "frmB"
Forms![frmB]![cboControl] = (Me.ValueFromFormA)
Forms![frmB]![sbfB].Form.Requery
Exit_Procedure:
On Error Resume Next
Exit Sub
Error_Handler:
Select Case Err
Case Else
MsgBox "Error: " & Err.Number & vbCr & Err.Description
Resume Exit_Procedure
End Select
End Sub