Re-query dilemma

  • 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 requery
dim bkm 'bookmark
'your code line
----
----
'open the subform
DoCmd.OpenForm "subform.name", , , , ,acDialog
if not me.newrecord then
bkm=me.bookmark
me.requery
me.bookmark=bkm
end if

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

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. 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
 
Back
Top