Solved

Auto update upon insert

Posted on 2002-06-19
4
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

732 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