Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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
 
Old October 20th, 2005, 11:44 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?

 
Old October 20th, 2005, 11:46 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

How familiar are you with VBA?

Mike
EchoVue.com
 
Old October 20th, 2005, 12:01 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old October 20th, 2005, 12:21 PM
Authorized User
 
Join Date: Oct 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Figgis
Default

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.
 
Old October 20th, 2005, 12:30 PM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

 
Old October 20th, 2005, 12:41 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old October 24th, 2005, 04:08 PM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!!

 
Old October 25th, 2005, 12:03 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

CStewart,

You say you have it working on the form. How are you doing that?

Kevin

dartcoach
 
Old October 25th, 2005, 03:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting new field to a table elygp SQL Language 3 March 19th, 2008 12:03 PM
Table / Field relationships Somed00d Access 2 February 8th, 2006 02:20 PM
Table field update ibelta Access 4 February 12th, 2005 08:22 PM
Renaming a Column/Field in Access Table james_sellwood ASP.NET 1.0 and 1.1 Professional 3 February 4th, 2005 08:45 AM
appending a field to a table Dmouse Access ASP 1 February 29th, 2004 05:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.