Solved

Auto update upon insert

Posted on 2002-06-19
4
243 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

828 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