Solved

Auto update upon insert

Posted on 2002-06-19
4
231 Views
Last Modified: 2008-03-06
Is it possible to have access auto update field values based on what the user has already input.  For example, if there are three fields: A, B, C -> user is asked to input A and B, and have access then automatically update the value for C as the concatination of the string A+B.  Is there anyway to run an auto query as the values are inputted. This of course works in excel, but does it in access?

On an unrelated note, is there a way to use the date field for only month and year or would that have to be text.

Thanks
0
Comment
Question by:salibes
  • 2
4 Comments
 

Accepted Solution

by:
Deebz earned 70 total points
ID: 7092721
Place C.Requery in the onchange event of both fields A and B.  "C" will have to be created with field criterias limited by the value of A and B.  

You can create a Year/Month value from a date with this code:  Month([YourDate]) & "/" & Year([YourDate]).  Yes, it would turn it into a text field.
0
 

Author Comment

by:salibes
ID: 7093433
can C be a text box instead of a list box.  If yes, what is the code, and would i put it in control source?
0
 

Expert Comment

by:m_bizon
ID: 7093454
You could put a query in the control source for the listbox and use A and B as parameters of that query.  Make sure to use the [xxx] when refering to A and B controls in your query.  This would be if C resides in a table somewhere.

Another way to change the contents of listbox C based on A and B would be to write a subroutine that populates the list box useing listbox.item.add (I beleive that is the syntax).  Then use that sub as the change event on A and B.

Hope this helps.
0
 

Author Comment

by:salibes
ID: 7093475
Thanks,

but , I want to have a value show up in a text box , not listbox.  if in a listbox i want it to become default selected.  I'd rather have it in a textbox, is this possible?
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question