UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Variation On Listbox, Access 2010    
 
   
ellenannie
post Jul 17 2017, 04:50 PM
Post#1



Posts: 23
Joined: 18-August 15



Hi, I know enough to be dangerous, but am still a newbie. I have been challenged to modify a query to allow the user to select values to input for a specific field. However, I would like to set it up so that the user need only enter the basic value and the query recognizes this and applies the "Like" function to it. See attached screenshot and further explanation.
Attached File(s)
Attached File  UtterAccess_List_box.jpg ( 198.5K )Number of downloads: 17
 
Go to the top of the page
 
theDBguy
post Jul 17 2017, 05:02 PM
Post#2


Access Wiki and Forums Moderator
Posts: 70,270
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Just a guess but maybe you can use the Left() function to generate your list.

Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
ScottGem
post Jul 18 2017, 07:47 AM
Post#3


UtterAccess VIP / UA Clown
Posts: 32,097
Joined: 21-January 04
From: LI, NY


I almost never use Parameter prompt queries. They are very limiting.

What I would recommend is that you create a form with a combobox where the user can select the System code. In your query use the criteria:

LIKE Forms!formname!comboname & "*"

Add a button to run the query. so when you select the code and run the query, it will look to the code in the combo.

--------------------
Scott <>
Scottgem's Blog
Microsoft Access MVP since 2007
Author: Microsoft Office Access 2007 VBA
Go to the top of the page
 
projecttoday
post Jul 18 2017, 08:29 AM
Post#4


UtterAccess VIP
Posts: 8,239
Joined: 10-February 04
From: South Charleston, WV


Your combo box is going to be based on the system codes table. If you don't have a system codes table, you would use SELECT DISTINCT on the other table (or make a system codes table). I don't see the need for LIKE here if they've selected a specific code that they want.

--------------------
Robert Crouser
Go to the top of the page
 
ellenannie
post Jul 19 2017, 12:30 PM
Post#5



Posts: 23
Joined: 18-August 15



Thanks for all of the suggestions. However, it is not clear whether these options allow for multiple System code values to be entered by the user. When I look at the responses they appear to assume only one entry is made. If the user wants to enter multiple values I envision a ListBox that incorporates a check box for multiple selections. Is this correct?
Go to the top of the page
 
projecttoday
post Jul 20 2017, 03:32 AM
Post#6


UtterAccess VIP
Posts: 8,239
Joined: 10-February 04
From: South Charleston, WV


Yes, if you want multiple selections at the same time then you would need a multi-select listbox (there are examples on this site) or a datasheet or continuous form with a checkbox. (Listboxes doh't have check boxes). Then you have to devise a way to modify your SQL code to produce all the desired selections.

--------------------
Robert Crouser
Go to the top of the page
 
ScottGem
post Jul 20 2017, 05:11 AM
Post#7


UtterAccess VIP / UA Clown
Posts: 32,097
Joined: 21-January 04
From: LI, NY


If you need to record multiple system codes then you have a many to many relationship. This is modeled with a junction table. So you are populating a separate table. with a record for each combination of system code and parented.

--------------------
Scott <>
Scottgem's Blog
Microsoft Access MVP since 2007
Author: Microsoft Office Access 2007 VBA
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th July 2017 - 03:39 AM