Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReQuery

Status
Not open for further replies.

kronar30

Programmer
Sep 8, 2004
74
US
I have a form 'frmEnterTime'
which has a subform 'EmpTimebyDate'
whos record source is 'UpdateTimeQuerybyDate'
order by 'JBT_Date DESC'
UpdateTimeQuerybyDate SQL is 'SELECT * FROM JBT_EmpTime ORDER BY JBT_Date DESC , JB_JobBidNo;'

After User adds a record I run the requery
qrycall = ChangeQueryDef("UpdateTimeQuerybyDate", "select * from [JBT_EmpTime] where JB_JobBidNo = '" & hldJobNum & "' order by JBT_Date DESC")
[TimebyDate].Form.Requery

The subform displays the new record added as long as the new recs job number is the same as the records originally displayed in the subform.
However if the new record has a diferent job number then the subform does not seem to update still showing the original job number records.

I thought that the requery would change the query for the record source and display the new results??

Thanks
 
The last update to the TimeByDate subform control sets the record source to "select * from [JBT_EmpTime] order by JBT_Date DESC, JB_JobBidNo" so it will display all records.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top