Form doesn't refresh based on combo box value

  • Thread starter Thread starter Xtof
  • Start date Start date
X

Xtof

Hi,

I used to be good at those things ... 10 years ago :=(

I have a form displayed in contuous form. It is based on a query. Within
that query one of the parameters refers to the value of a combo bow control
that is placed in the header of the form. The issue is that when I select
another value with the combo bowx control, the form doesn't update. I have
tried forcing the form to refresh by placing a refresh method line in the
combo box AfterUpdate event but no can do.

The stange thing is that the Refresh All button in the toolbar does a good
job at updating the form after I changed the combo box value.

Any help would be much appreciated.

Xtof.
 
Xtof said:
Hi,

I used to be good at those things ... 10 years ago :=(

I have a form displayed in contuous form. It is based on a query. Within
that query one of the parameters refers to the value of a combo bow
control
that is placed in the header of the form. The issue is that when I select
another value with the combo bowx control, the form doesn't update. I have
tried forcing the form to refresh by placing a refresh method line in the
combo box AfterUpdate event but no can do.

The stange thing is that the Refresh All button in the toolbar does a good
job at updating the form after I changed the combo box value.

Any help would be much appreciated.

Xtof.

Please post the code you're using.
 
There you go :

I have just one line of code :

Forms![frmListOperations].Requery

It is in the combo box AfterUpdate event.
 
Xtof said:
There you go :

I have just one line of code :

Forms![frmListOperations].Requery

It is in the combo box AfterUpdate event.

Because this code is in the form's module, you can go:

Me.Requery

However, that probably won't solve the problem.

Are you sure the query is referencing the combo correctly?
 
I have try the "Me" syntax before but in my quest for a solution, I tried
different options.

The query SQL is below ( a bit long = th ereference to the form control is
at the end) and the reference seems to be correct because it gets updated
correctly when I click the Refresh All button.

SELECT
tblOperation.OpID, tblOperationType.OtDesc, tblOperation.OpDate,
tblOperation.OpMonth, tblOperation.OpDesc, tblOperation.OpMemo,
tblOperation.OpPmID, tblOperationLine.OlAcID, tblAccount.AcShDesc,
Sum(IIf([OlType]='D',+1,-1)*[OlAmount]) AS IncAmount
FROM
tblOperationType INNER JOIN (tblAccount INNER JOIN (tblOperation INNER
JOIN
tblOperationLine ON tblOperation.OpID = tblOperationLine.OpID) ON
tblAccount.AcID = tblOperationLine.OlAcID) ON tblOperationType.OtID =
tblOperation.OpOtID
GROUP BY
tblOperation.OpID, tblOperationType.OtDesc, tblOperation.OpDate,
tblOperation.OpMonth, tblOperation.OpDesc, tblOperation.OpMemo,
tblOperation.OpPmID, tblOperationLine.OlAcID, tblAccount.AcShDesc
HAVING
(((tblOperationLine.OlAcID)=[Forms].[frmOperationList]![cboAccount]))
ORDER BY
tblOperation.OpDate;
 
Back
Top