Hello
Please help,
I have this table ‘Source_RM’:
Source.......Raw Material.....Waste Date..... Waste Quantity
Store ..........Sugar.............13/06/2013.................10
Store...........Salt...............12/06/2013.................13
Production.....Sugar............17/06/2013.................10
Vendor..........Sugar............15/06/2013.................10
I have a main form where the client can perform queries passed on controls (text box, combo box ..)
In the main form I need to display a query result passed on combo box value:
The result wanted: the client choose the source from a combo box so the result will be a table contain the source and total waste i.e.:
Source ...Total
Store.......23
What I did is:
1. Created a form (“Blank Form”) name it: frmResult
2. In the main form I added Subform, In subform wizard in use an existing form I chose ‘frmResult’
3. After I choose the source from ‘cmdSource ‘ and click the button’ cmdFilter’
4. I wrote this code in VBA :
Private Sub cmdFilter_Click()
Me.FormTemp.Form.RecordSource = "SELECT Source_ID, SUM(Quantity) AS Total FROM Source_RM WHERE Source = ' " & Me. cmdSource.Value & " ' GROUP BY Source_ID"
End Sub
After I click the button the FormTemp has the RecordSource (I know from the record number at the bottom bar’ 1 of 2’) but the FormTemp still blank .. I need to show the result of query in FormTemp
Note : Date entry in FormTemp is set to NO.
Please any Ideas

Please help,
I have this table ‘Source_RM’:
Source.......Raw Material.....Waste Date..... Waste Quantity
Store ..........Sugar.............13/06/2013.................10
Store...........Salt...............12/06/2013.................13
Production.....Sugar............17/06/2013.................10
Vendor..........Sugar............15/06/2013.................10
I have a main form where the client can perform queries passed on controls (text box, combo box ..)
In the main form I need to display a query result passed on combo box value:
The result wanted: the client choose the source from a combo box so the result will be a table contain the source and total waste i.e.:
Source ...Total
Store.......23
What I did is:
1. Created a form (“Blank Form”) name it: frmResult
2. In the main form I added Subform, In subform wizard in use an existing form I chose ‘frmResult’
3. After I choose the source from ‘cmdSource ‘ and click the button’ cmdFilter’
4. I wrote this code in VBA :
Private Sub cmdFilter_Click()
Me.FormTemp.Form.RecordSource = "SELECT Source_ID, SUM(Quantity) AS Total FROM Source_RM WHERE Source = ' " & Me. cmdSource.Value & " ' GROUP BY Source_ID"
End Sub
After I click the button the FormTemp has the RecordSource (I know from the record number at the bottom bar’ 1 of 2’) but the FormTemp still blank .. I need to show the result of query in FormTemp
Note : Date entry in FormTemp is set to NO.
Please any Ideas