P
Peter D
Please help,
I have a main form which uses unbound controls where a user can enter a from
and to date value as parameters for a query.
A subform then uses these two controls values in the query to retrieve the
data contained between the given date range.
After the user changes the values in the main form's date text boxes the
subform is meant to then requery the data and update the datasheet recordset
it displays. But it shows NO data at all
The code i'm using after the date text fields are updated to requery the
subform's recordset is;
Private Sub txtDateFrom_AfterUpdate()
Me.Show_monthly_totals_SUB.Form.Requery
Me.Show_monthly_totals_SUB.Form.Refresh
Me.Show_monthly_totals_SUB.Requery
Me.Refresh
End sub
I have tried an assortment of requery/refreshing but the subform just
refuses to show any data, I must be missing something.
The subform references the following query and I know the query works
because if its ran while the main form is open it shows the correct data.
query sql for reference is:
SELECT tblAccounts.dateOfPayment, Sum(tblAccounts.MRPpayment) AS
SumOfMRPpayment, Sum(tblAccounts.MRPgstamount) AS SumOfMRPgstamount,
([SumOfMRPpayment]-[sumofMrpgstamount])*0.8006 AS AccountA,
([SumOfMRPpayment]-[ACCOUNTA]) AS AccountB, Max(tbl_clients.ALPS2ID) AS
MaxOfALPS2ID
FROM tbl_clients LEFT JOIN tblAccounts ON tbl_clients.client_id =
tblAccounts.clientID
GROUP BY tblAccounts.dateOfPayment
HAVING (((tblAccounts.dateOfPayment) Between [forms]![show monthly
totals]![txtDateFrom] And [forms]![show monthly totals]![txtDateto]) AND
((Max(tbl_clients.ALPS2ID))<>""));
thanks in advance
Peter.
I have a main form which uses unbound controls where a user can enter a from
and to date value as parameters for a query.
A subform then uses these two controls values in the query to retrieve the
data contained between the given date range.
After the user changes the values in the main form's date text boxes the
subform is meant to then requery the data and update the datasheet recordset
it displays. But it shows NO data at all
The code i'm using after the date text fields are updated to requery the
subform's recordset is;
Private Sub txtDateFrom_AfterUpdate()
Me.Show_monthly_totals_SUB.Form.Requery
Me.Show_monthly_totals_SUB.Form.Refresh
Me.Show_monthly_totals_SUB.Requery
Me.Refresh
End sub
I have tried an assortment of requery/refreshing but the subform just
refuses to show any data, I must be missing something.
The subform references the following query and I know the query works
because if its ran while the main form is open it shows the correct data.
query sql for reference is:
SELECT tblAccounts.dateOfPayment, Sum(tblAccounts.MRPpayment) AS
SumOfMRPpayment, Sum(tblAccounts.MRPgstamount) AS SumOfMRPgstamount,
([SumOfMRPpayment]-[sumofMrpgstamount])*0.8006 AS AccountA,
([SumOfMRPpayment]-[ACCOUNTA]) AS AccountB, Max(tbl_clients.ALPS2ID) AS
MaxOfALPS2ID
FROM tbl_clients LEFT JOIN tblAccounts ON tbl_clients.client_id =
tblAccounts.clientID
GROUP BY tblAccounts.dateOfPayment
HAVING (((tblAccounts.dateOfPayment) Between [forms]![show monthly
totals]![txtDateFrom] And [forms]![show monthly totals]![txtDateto]) AND
((Max(tbl_clients.ALPS2ID))<>""));
thanks in advance
Peter.