If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
You'll need to show what you're trying to do in the query based on what's in
the textbox. If you're separating the values with commas, you likely could use the value from the text string in a "IN" clause string. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked perfectly, but i"m having a little problem when i run a query on a specific Diagnosis from the text box. is not showing me any records. I though that by putting a comma after each diagnosis i pick from the combo box into the text box i could run a query on a specific one but is not working. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#12
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
for example in the textbox i have ADD,Anxiety, Depression, but i want to run
a query only on those kids that have a depression. When i run it nothing comes up. Since the field have to much information on it. "Ken Snell MVP" wrote: You'll need to show what you're trying to do in the query based on what's in the textbox. If you're separating the values with commas, you likely could use the value from the text string in a "IN" clause string. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked perfectly, but i"m having a little problem when i run a query on a specific Diagnosis from the text box. is not showing me any records. I though that by putting a comma after each diagnosis i pick from the combo box into the text box i could run a query on a specific one but is not working. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#13
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
How is your query supposed to be told that you only want it to look at one
of the three values in the textbox? How do you know which one you want to use? -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... for example in the textbox i have ADD,Anxiety, Depression, but i want to run a query only on those kids that have a depression. When i run it nothing comes up. Since the field have to much information on it. "Ken Snell MVP" wrote: You'll need to show what you're trying to do in the query based on what's in the textbox. If you're separating the values with commas, you likely could use the value from the text string in a "IN" clause string. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked perfectly, but i"m having a little problem when i run a query on a specific Diagnosis from the text box. is not showing me any records. I though that by putting a comma after each diagnosis i pick from the combo box into the text box i could run a query on a specific one but is not working. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#14
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
if i decide to change my combobox to a list box to able to make mutiple
selections what would change from the below coding. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#15
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
The changes needed depend upon how you want the list box to behave. Do you
want to make all the selections in the listbox first, then click a button to copy them to the textbox? Or do you want each selection to appear in the textbox as you select it in the listbox (and if this is what you want, how should the form behave if you "unselect" an item in the listbox)? -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... if i decide to change my combobox to a list box to able to make mutiple selections what would change from the below coding. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#16
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
I want to click on the command button have the listbox appear then make all
the selection in the listbox and have then appear in the textbox when i'm done selecting i want the listbox to be invisible. if i unselect an item i want it to be removed automatically from my textbox, "Ken Snell MVP" wrote: The changes needed depend upon how you want the list box to behave. Do you want to make all the selections in the listbox first, then click a button to copy them to the textbox? Or do you want each selection to appear in the textbox as you select it in the listbox (and if this is what you want, how should the form behave if you "unselect" an item in the listbox)? -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... if i decide to change my combobox to a list box to able to make mutiple selections what would change from the below coding. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
#17
|
|||
|
|||
Creating a Drop down list where can pick more than one choice
The code for the command button, where we'll use the same command button to
do both tasks (make the listbox visible, and write the selected items into the textbox): Private Sub CommandButtonName_Click() Dim strWhere As String Dim varItemSel As Variant Const strCommaBlank As String = ", " strWhere = vbNullString Select Case Me.ListBoxName.Visible Case True ' build comma-separated list of items selected in listbox For Each varItemSel In Me.ListBoxName.ItemsSelected strWhere = strWhere & _ Me.ListBoxName.ItemData(varItemSel) & strCommaBlank Next varItemSel ' strip off trailing comma and space If Len(strWhere) 0 Then _ strWhere = Left(strWhere, Len(strWhere) - Len(strCommaBlank)) Me.TextBoxName.Value = strWhere Me.ListBoxName.Visible = False Case False ' empty the textbox Me.TextBoxName.Value = Null ' make listbox visible Me.ListBoxName.Visible = True ' set focus to listbox Me.ListBoxName.SetFocus End Select End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I want to click on the command button have the listbox appear then make all the selection in the listbox and have then appear in the textbox when i'm done selecting i want the listbox to be invisible. if i unselect an item i want it to be removed automatically from my textbox, "Ken Snell MVP" wrote: The changes needed depend upon how you want the list box to behave. Do you want to make all the selections in the listbox first, then click a button to copy them to the textbox? Or do you want each selection to appear in the textbox as you select it in the listbox (and if this is what you want, how should the form behave if you "unselect" an item in the listbox)? -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... if i decide to change my combobox to a list box to able to make mutiple selections what would change from the below coding. "Ken Snell MVP" wrote: To use a command button to make your combobox visible for selecting an item, then to have it become invisible after you make the selection: Private Sub CommandButtonName_Click() Me.NameOfYourComboBox.Visible = True Me.NameOfYourComboBox.SetFocus Me.NameOfYourComboBox.Dropdown End Sub Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) Me.CommandButtonName.SetFocus Me.NameOfYourComboBox.Visible = False End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... your first suggestion worked, the problem was that in the form view both the combo box and text box were display. i would like is to have a select button that would display my list box then when the selection is made in the list box it would transfer to the text box. If that is not possible send me the code for the below "Ken Snell MVP" wrote: I don't understand what you mean by "a link". If you want to select all items and then have them show up in a text box, you'll need to use a listbox (as suggested by Arvin. You then will need code to "read" all the selections in the listbox and put them in the text box. Post back if you want to use this setup and need help with the code. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... It worked, but can i change the view of the combo box. Is there any way to make it a link? I would like to be able to just click on the link to see my choices select them and have them enter in my text box. "Ken Snell MVP" wrote: A combobox will not let you select more than one option. However, you can have your choices be added to a textbox's string value as you make them: Private Sub NameOfYourComboBox_AfterUpdate() Me.NameOfTextbox.Value = (Me.NameOfTextbox.Value & vbNullString) & _ (Me.NameOfYourComboBox.Value & vbNullString) End Sub You'll need to ensure that your textbox is empty when you start. You can do that manually or you can use a command button to empty the textbox: Private Sub NameOfYourCommandButton_Click() Me.NameOfTextbox.Value = Null End Sub -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Jessica" wrote in message ... I would like to creat a dropdown list in which i can select more then one option and have the options i selected display in a comment of box or text box. The dropdown list will be a command button and when i click on it it will display my dropdown list. I wish i can send and attachment of what i need. |
|
Thread Tools | |
Display Modes | |
|
|