 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 20th, 2005, 11:44 AM
|
|
Registered User
|
|
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Help with field expressions in access table
I am trying to set up a field in a table to automatically populate upon either (a) a prior field being populated or (b) upon close. Can someone help me with the language for this?
|
|

October 20th, 2005, 11:46 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
How familiar are you with VBA?
Mike
EchoVue.com
|
|

October 20th, 2005, 12:01 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
What you probably want to do is to create a data entry form, and then setup events for the loss of focus on the previous field and on the close evnt of the form. If you aren't familiar with VBA, it really isn't that scary, and I would be happy to walk you through it.
Let me know
Mike
Mike
EchoVue.com
|
|

October 20th, 2005, 12:21 PM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I use the OnChange property on forms to trigger events that update other fields. You can do the same for the OnClose property of a form.
|
|

October 20th, 2005, 12:30 PM
|
|
Registered User
|
|
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am somewhat familiar with VBA. I already have a form created and have the function working in the form, however 90% of the updates to this particular field are done in the the table therefore, need to see if there is a solution there. Any other ideas?
|
|

October 20th, 2005, 12:41 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
This one sounds tricky - But if it wasn't your wouldn't be asking!!!
If you don't mind my asking - what kind of calculation are you trying to do, and how is the table being updated? Perhaps we could explore other options for the update.
Mike
EchoVue.com
|
|

October 24th, 2005, 04:08 PM
|
|
Registered User
|
|
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What I want is this:
In the table, there is a field that is a check box (yes/no). I want the field after the check box to automatically populate with a date when the box is checked. Does that make sense? Like I said, I have that working in the form, but can't seem to figure out how to get it to work in the table (or if it's even possible).
Thanks!!
|
|

October 25th, 2005, 12:03 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
CStewart,
You say you have it working on the form. How are you doing that?
Kevin
dartcoach
|
|

October 25th, 2005, 03:32 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
CStewart, you said that 90% of the updates are done in the table and you want this to happen in the table. This is bad practice.
Never let anyone update your data directly in the table. All data entry, editing, and deletion should be done on a form based on the table or a query. From that form, you can use VBA to alter any data based on the AfterUpdate event code of any field.
|
|
 |