Re-query

  • Thread starter Thread starter Gary Nelson
  • Start date Start date
G

Gary Nelson

In Access2000 - frontend, SQL - backend, I have a form and a subform. The
form contains data specific to an order that we received inclusive of a
DueDate. (The DueDate is automatically generated once certain criteria have
been met.) There are certain instances when the DueDate has to be changed.
Therfore, I created a command button which takes the user to the subform.
The subform allows the user to change the DueDate + / - a specified number
of days. The enter a reason why the date is being changed then exit the
subform and return to the main form which is still open.

My dilemma is that once I exit the subform, I need the main form to update
the DueDate with the new date established in the subform, and I don't want
the user to have to search to locate the job they just changed. I believe
this can be done as a Re-query, but my knowledge of re-querying is limited.
Is the requery done in the sub-form or the main form? What is the structure
of the code used? Please help.

Thanks
Rookie
 
Hi Gary

iguess you can use recalc or requery to solve this. try this code on the command button click event

'using requer
dim bkm 'bookmar
'your code lin
---
---
'open the subfor
DoCmd.OpenForm "subform.name", , , , ,acDialog
if not me.newrecord then
bkm=me.bookmar
me.requer
me.bookmark=bk
end i

'using recalc is simple
DoCmd.OpenForm "subform.name", , , , ,acDialog
me.recal

You need to use argument acDialog on Docmd.Openform, just to make the code stop running until the subform is closed

Hope this help

----- Gary Nelson wrote: ----

In Access2000 - frontend, SQL - backend, I have a form and a subform. Th
form contains data specific to an order that we received inclusive of
DueDate. (The DueDate is automatically generated once certain criteria hav
been met.) There are certain instances when the DueDate has to be changed
Therfore, I created a command button which takes the user to the subform
The subform allows the user to change the DueDate + / - a specified numbe
of days. The enter a reason why the date is being changed then exit th
subform and return to the main form which is still open

My dilemma is that once I exit the subform, I need the main form to updat
the DueDate with the new date established in the subform, and I don't wan
the user to have to search to locate the job they just changed. I believ
this can be done as a Re-query, but my knowledge of re-querying is limited
Is the requery done in the sub-form or the main form? What is the structur
of the code used? Please help

Thank
Rooki
 
Back
Top