Question on Comboboxes (4 Viewers)

Technics

Member
Local time
Today, 17:55
Joined
Aug 9, 2025
Messages
50
I have a customer form with source customer table. The table was originally setup with first and last name but I've found I need a company name and sometimes just the company name because some companies do not want a persons name as part of the invoice address. I have added CompanyName to the table and already have a combobox for choosing the first and last name. How or can I add an additional combobox if I only want to choose the company name to add to the address field. In other words choose one or the other to populate the invoice address.
 
Are the chosen values saved in the same field in the table? What is the control source of your current combobox and if you showed the company name where would that get saved?
 
There are probably a few ways to do this.
You could union the values and in one combobox see both people names and company names if people names do not exist.
You could have a radio button over the combobox (Pick Person Name, Pick Company Name) and change the rowsource of the combobox
 
Use the company name, and if the table record also has the first and last name, use that in the invoice.
Now first and last name controls can be read only.
 
Are the chosen values saved in the same field in the table? What is the control source of your current combobox and if you showed the company name where would that get saved?
No, a field for each. I have a customer form that saves first, last, address, city, state and zip. The combobox is on the order form. In using you choose the name, first/last from the combobox and all other info is auto into the order form. I have a query using customerID with LF: [LastName] & ", " & [FirstName] that fills current combobox. I am trying how to best fit the company name into this setup either with the same combobox or one just for company name.
 
sometimes just the company name because some companies do not want a persons name as part of the invoice address

It depends on what you mean by that statement. If you have both the person's and company names, are you saying the invoice coould potentially display both or just the person or just the company name based on the company's preference? Also, if a company does not want a person's name to show in the invoice, do they still provide a person's name for your customer table or do the first and last name columns remain blank for them?
 
It depends on what you mean by that statement. If you have both the person's and company names, are you saying the invoice coould potentially display both or just the person or just the company name based on the company's preference? Also, if a company does not want a person's name to show in the invoice, do they still provide a person's name for your customer table or do the first and last name columns remain blank for them?
In writing my last comment, sometimes you write your own answer, I think I have figured it out. Seemed to simple, but hey. I believe the answer is [CompanyName] & "," & [LastName] & ", " & [FirstName]. To answer your question, if the company does not want a persons name the first and last name fields will remain empty and vise versa. If they want all three, all three fields will be full and show on the invoice. If you have an idea of having all three but choosing which goes to the invoice let me know. Right now if there is a persons name but not for the invoice, it will go in the notes field.
 
To answer your question, if the company does not want a persons name the first and last name fields will remain empty and vise versa. If they want all three, all three fields will be full and show on the invoice. If you have an idea of having all three but choosing which goes to the invoice let me know.
One approach I was thinking, if you want to allow all three info to display in the invoice, is to add a Yes/No field to indicate "CompanyOnly." Also, to avoid having extra commas in your solution, you could try something like:
Code:
[CompanyName] & ("," + [LastName]) & ("," + [FirstName])
Are you sure you don't want any spaces after the commas? Just curious...
 
In writing my last comment, sometimes you write your own answer, I think I have figured it out. Seemed to simple, but hey. I believe the answer is [CompanyName] & "," & [LastName] & ", " & [FirstName]. To answer your question, if the company does not want a persons name the first and last name fields will remain empty and vise versa. If they want all three, all three fields will be full and show on the invoice. If you have an idea of having all three but choosing which goes to the invoice let me know. Right now if there is a persons name but not for the invoice, it will go in the notes field.
I was thinking
FirstName & " " & LastName
CompanyName
AdressLine1
AddressLine2
etc

on the invoice, so if no person's name that would be blank?
 
One approach I was thinking, if you want to allow all three info to display in the invoice, is to add a Yes/No field to indicate "CompanyOnly." Also, to avoid having extra commas in your solution, you could try something like:
Code:
[CompanyName] & ("," + [LastName]) & ("," + [FirstName])
Are you sure you don't want any spaces after the commas? Just curious...
Right now with what I am using I have only spaces. Using dash between Co name and persons name.
invoice.jpg
 
I was thinking
FirstName & " " & LastName
CompanyName
AdressLine1
AddressLine2
etc

on the invoice, so if no person's name that would be blank?
This is what I am thinking about now. Only problem is if I don't use Co name there is a blank space between persons name and address. Is there a way to get around that.
 

Users who are viewing this thread

Back
Top Bottom