Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-12-05 : 08:02:56
|
Gary writes "In Access2000 - frontend, SQL - backend, I have a form and a subform. Theform contains data specific to an order that we received inclusive of aDueDate. (The DueDate is automatically generated once certain criteria havebeen 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 numberof days. The enter a reason why the date is being changed then exit thesubform 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 updatethe DueDate with the new date established in the subform, and I don't wantthe user to have to search to locate the job they just changed. I believethis 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 structureof the code used? Please help.ThanksRookie" |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-12-05 : 09:02:15
|
If I hear you right, i think you are saying the problem is on the main form, they are perhaps in Record #3.Then, they open a subform, change some values, and close it.Then, they are back at the main form. But, changes in the subform are not reflected. So, to get those changes, you say:Me.RequeryBut -- that then puts the user back on the first record in the table, and then they have to manually go back to the record where they were. Very ugly indeed!If that's right -- the answer is:Instead of just requerying the main form, try this:dim CurrRec as longCurrRec = me.currentrecordme.requerydocmd.gotorecord acDataForm, Me.Name, acGoTo, CurrRecThat should save the current record #, do a requery on the form, and put you right back there. Try it, let me know if it helps.There's also a bookmark property of the form that may work better as well -- you can save it into a variant i believe, requery, and then go BACK to that bookmark. read help for more info.- Jeff |
 |
|
|
|
|
|
|