How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask NewITZone Your Own Question
NewITZone, Computer Enthusiast
Category: Microsoft Office
Satisfied Customers: 90
Experience:  I have been using Office Pro for 10 years and implemented applications for business use.
Type Your Microsoft Office Question Here...
NewITZone is online now
A new question is answered every 9 seconds

I'm trying to figure out how to auto-fill a field in an

Customer Question

I'm trying to figure out how to auto-fill a field in an Access form based on a selection made in a different field within the same form.
Submitted: 1 year ago.
Category: Microsoft Office
Expert:  GeekGal replied 1 year ago.

Hi there! My name is***** am a computer professional with over 15 years of experience with both Mac and Windows. It would be my pleasure to help you with this. Would you mind telling me please what version of Access you are using to create the form? Once I know that I can provide detailed instructions.

Customer: replied 1 year ago.
It's Access 2016
Expert:  GeekGal replied 1 year ago.

Thank you for that information. This can definitely be done using lookup tables. I am going to provide a link to a very well written article for you to review as it has illustrations, etc and it would take me quite a bit of time to create a sample table and form. Please click the link below to access the article.

Please give this a try and let me know how it works for you. If you need more help, please let me know so I can continue to assist you.

Expert:  GeekGal replied 1 year ago.

As a quick and simple example, say that we have have a table named MAIN that contains the Employee lookup field from the Employees table. Also in the employees table is the hourly rate for each employee. We want to set the rate field in the Main table to automatically pull the rate from the Employee table to update when the employee is selected.

There are two different ways that we can do this.

Method 1

If we just want to display the rate, we can include that field in the RowSource of the Employee combo (eventually with a Width of 0 to hide it). Then,we can bind the Rate control on the form to an expression like

=Employee.Column(2) *note that Column method is 0 based, so Column(2) is the 3rd column.METHOD 2If we want to save the historical value of the Rate in the Main table, then we'll need to include that field in the Employee combo RowSource as before, and add the following code to the Employee.AfterUpdate event: Rate = Employee.Column(2)This is a very simplified explanation, but once you're clear on the logic behind it, the article will help you to fine tune things.
Customer: replied 1 year ago.
I'm sorry, that explanation is not detailed enough for me to apply it to my situation. There is a table called Reports, which has a form associated with it for data entry. Each record in the Reports table is associated with a specific company, and each company has two names: one is called DisplayName, the other is just Company. Both names for each company are pulled from a query. I want to setup the data entry form so that the user selects the DisplayName from a combo box, and then the corresponding "full name" (Company) will populate automatically in a different field and be stored in the record along with the DisplayName.
Expert:  GeekGal replied 1 year ago.

I will opt out in the hopes that another expert will be able to help you with this. Have a good evening!

Expert:  swmcdonnell replied 1 year ago.

Hi there, my name is ***** ***** I can help you autopopulate the field. Can you create a zip file of the Access database and attach it to our conversation using the paperclip icon? That way I can look at exactly what you're trying to change and tell you what you need to do to have it behave the way you want.

Customer: replied 1 year ago.
Unfortunately I am not able to do that, so I will try to describe the situation as best I can. We have a table called tblCompany that contains a list of companies and related information (address, phone number, etc.). One of the fields in the table is called DisplayName, which is a shorter version of the company's full name (e.g. "Boeing" instead of "The Boeing Company"). Both the full name and DisplayName are stored in tblCompany, and the full name (Company) is the primary key. We are only collecting information on a small number of the companies that are in tblCompany, so only those companies have a DisplayName populated in their record in tblCompany. To simplify the data entry process, I have setup a query that only pulls the names of companies that have the DisplayName field populated in tblCompany, and I have that query setup as the row source for the DisplayName field in the form attached to tblReports. That's the table into which we are entering data through the form, and it also has both the Company and DisplayName fields. What I want to do is the following: when the user selects a DisplayName from the combo box in the form, I want to have the Company field populate automatically with the full Company name that is associated with the selected DisplayName. I don't know if this has to be done with an event procedure written in VBA or if it can be written in SQL, nor do I know where in the form or field properties to specify this action. I am also not fluent in either language unfortunately. I hope this information gives you a better idea of the solution I'm looking for. Thank you for your assistance.
Expert:  swmcdonnell replied 1 year ago.

If you want to have a remote session, I can just do it for you that way. I think they make me charge you an extra $5. Otherwise I can write out instructions that should get you there, but might not be exact because I can't see exactly how your database and form are constructed. Let me know how you'd like to proceed.

Related Microsoft Office Questions