checkboxes

sentient_amoeba

Registered User.
Local time
Today, 21:16
Joined
Jul 21, 2003
Messages
10
Hi everyone

I'm trying to create a set of checkboxes on a form that will give our customers a salutation: a box for Mr., a box for Ms., a box for Dr., and so on.

I have a record on my customer table called "salutation" for this information. How can I add the appropritate salutation to the record by checking the appropriate checkbox?

(I would also like the apprpriate box to remain checked when I gp back to the customer's form.)

Thanks so much! :) :cool:
 
Use a combobox with a list of titles; it's more sensible.
 
Thanks, Mile-o-phile,

But when I use a combo box I get a list of Mr. Mr. Ms. Ms. Dr. Mr. Ms, ... I don't want a list of every salutation for every customer. Just those three: Mr. Ms. Dr.

Any suggestions?

Thanks
 
Create a Value List in the combo's RowSource instead of taking it from a Table/Query
 
Use a combo box with a row source type of value list and then list the possible choices in the row souce property.

GumbyD
 
Create an Option Group.
Name it: opt_Salutation

If you use a Wizard it will create the Options for you.
Otherwise you need the following Options:

Check Box: opt_Mister
Option Value: 1

Check Box: opt_Missus
Option Value: 2

Check Box: opt_Doctor
Option Value: 3

Now, I created a Textbox to test it.
I named the textbox: txt_SalutationSelected
You could change the txt_SalutationSelect to whatever field you need to record the selection...

Then, set the following event as such:

Private Sub opt_Salutation_Click()

Select Case opt_Salutation
Case 1: txt_SalutationSelected.Value = "Mr."
Case 2: txt_SalutationSelected.Value = "Mrs."
Case 3: txt_SalutationSelected.Value = "Dr."
End Select

End Sub

That should set you up...
 
Thanks!

Thanks so much Randomblink, GumbyD, and Mile-O-Phile! All these suggestions worked.

I really appreciate your help! :D
 
Use a group query for your combo source

Create a query from your table and group by the salutation. Use this as the datasource for the combobox. This will limit your combobox list to one occurence of each salutation. The advantage here is that if you get something unusual or unexpected (eg Dean, Rev. Dr., Her Royal Highness, Lt. etc) it will get added as well. If you don't have one in your table, it obviously won't show.
 

Users who are viewing this thread

Back
Top Bottom