PDA

View Full Version : Child Form



kbsudhir
09-26-2008, 07:34 AM
Hi All,

I have a childform where I want to pull the data from a table as per the criteria.

The Criteria is Start Date, End Date & Teamname selected on the controls available in parent form.

So that when I click the button the data is displayed in the child from.
I want to requery the below query in the button click.

SELECT LeavePlanner.Name, LeavePlanner.LeavesStartDate, LeavePlanner.LeavesEndDate, LeavePlanner.Team
FROM LeavePlanner WHERE (((LeavePlanner.LeavesStartDate)<= Forms!LeavePlans!StartDateCal) AND ((LeavePlanner.LeavesEndDate)<=Forms!LeavePlans!StartDateCal) AND ((LeavePlanner.Team)=Forms!LeavePlans!NameList))
GROUP BY LeavePlanner.Name, LeavePlanner.LeavesStartDate, LeavePlanner.LeavesEndDate, LeavePlanner.Team;

I want to know how to go about doing this.

:think: :think:

Thanks
Sudhir

nepotist
09-26-2008, 11:00 AM
Once you click the button it should delete the query and requery based on the selected values in the form
to delete query
DoCmd.DeleteObject acQuery, "ABC"
then reassign the query
strSQL = [your query]
Set QueDef = DB.CreateQueryDef("ABC", strSQL)
let me know if that works

kbsudhir
09-26-2008, 11:04 AM
And how to map it to the child form..??

nepotist
09-26-2008, 11:35 AM
link the master and child form with there common fields.. If that is what you are asking
select the child form ,properties,data window and link the master and child form there