By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,657 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,657 IT Pros & Developers. It's quick & easy.

auto form update

P: 12
I have a form, lets call it form A, that displays a list of projects that need completed. The record source for form A is a simple select Query. when you click on a record it shows a detailed description of the task in a new form, lets call it form B. Form A stays open in the background while form b is open. There is a button on form B which marks the task as completed, which is a yes/no box in the source table. this button also closes form B. My problem is the list of projects does not automatically update form A when form B is closed. Is there a way to make it auto update. everytime i try DoCmd. requery I either get no result or an error message. Any guidance?
Feb 7 '08 #1
Share this Question
Share on Google+
3 Replies


P: 14
I have a form, lets call it form A, that displays a list of projects that need completed. The record source for form A is a simple select Query. when you click on a record it shows a detailed description of the task in a new form, lets call it form B. Form A stays open in the background while form b is open. There is a button on form B which marks the task as completed, which is a yes/no box in the source table. this button also closes form B. My problem is the list of projects does not automatically update form A when form B is closed. Is there a way to make it auto update. everytime i try DoCmd. requery I either get no result or an error message. Any guidance?
The record on form A retains the focus while you are in form B. So in your button click event just set the value directly:

forms![formA]![status] = me![status]
Feb 7 '08 #2

P: 12
Forms![OpenTest2]![Status] = Me![Status]
DoCmd.close

that it what I put inside form 2 right before close. OpenTest2 is the name of Form A. Access gives me the error:
"Access can't find the field 'Status' referred to in your expression." It is referring to the "=me![Status]".
what did i do wrong?
Feb 7 '08 #3

NeoPa
Expert Mod 15k+
P: 31,712
In FormB put :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Close()
  2.   '... Any existing code
  3.   Call Forms![FormA].Requery
  4. End Sub
Feb 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.