Automatic posting in TextBox/ComboBox in Forms

  • Thread starter Thread starter Larry D.
  • Start date Start date
L

Larry D.

Guest
Hello Everyone!

I hope someone can guide me in the right direction. I have developed a database to keep track of Service Calls we receive. We manufacture and/or service a wide range of products from Automatic Laundry/Kitchen chemical dispensers to office furniture. We are currently using this data base and it works well, I'm trying to make it easier for the user.

I have a form to enter information into a table, tblService Calls. In the form I have a ComboBox labeled Issue Code which looks up information in a table tblService Issue. I also have a ComboBox labeled Service Issue which also looks up information in the tblService Issue.

tblServiee Issue looks like this:
Issue Code Service Issue
101 Laundry Install
201 Kitchen Install
and so on

What I'm trying to do is when I enter issue code 101 in ComboBox Issue Code, I would like the Service Issue (Laundry Install) to automatically post in the ComboBox or TextBox labeled Service Issue. Is this possible?

Thank you in advance for any help you can give me!
Larry D.
 
Do you need to display BOTH the code and description? If so you might consider using a List box instead of a combo. If you only need to show the description, then just set the first column (the code) to 0" in the column widths. A combobox will only display the first non zero width column. If you want to show both but in different controls you can add an UNBOUND control and set its datasource to:

=cboIssueCode.Column(1)

This assumes the RowSource for the Issue code combo looks like:

SELECT IssueCode, Service FROM tblServices;
 
First, private messages should only be used for personal correspondence. To post a follow up questions reply in the thread.

Second, You have to use your actual control names. I used cboIssueCode as an example. You need to use the actual name of the combobox where you select the Issuecode.
 
ScottGem

Thanks for your help. I did use my own control names as well as your example to see if anything would work. I got error messages. What I found to work is the expression: =[Forms]![frm Service Calls]![combo50].column(1) in the ControlSource. However, although this automatically displays the informaton from the ComboBox in the TextBox, It's not placing the information in the table. Any suggestions?

Sorry about the personal message.

Thanks,
Larry D.
 
ScottGem

Thanks for your help. I did use my own control names as well as your example to see if anything would work. I got error messages. What I found to work is the expression: =[Forms]![frm Service Calls]![combo50].column(1) in the ControlSource. However, although this automatically displays the informaton from the ComboBox in the TextBox, It's not placing the information in the table. Any suggestions?

Sorry about the personal message.

Thanks,
Larry D.
 
That's because it shouldn't be in the table. One of the principles of relational databases is to eliminate redundant data. Since you can get to The Service Issue by joinng to that table using the IssueCode you don't need to store it in the Service Calls table. You just want to display it on the form.

By the way:

=[combo50].Column(1)

should work.
 
Thank you ScottGem. This expression works great. Thanks for all your help.

Larry D.
 

Users who are viewing this thread

Back
Top Bottom