473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Multiple Values in Single Field

I have inherited a medical database in which there are multiple values
stored in a single field (ie. "Current Conditions" field might contain
1-20 different conditions, separated by comma (ie. "Heart
Disease,Hyper Tyroid,Cancer" etc.

I would like to search via combo box for any one or more than one
value in this field, ie-what patients have Heart Disease or Cancer by
selecting these disorders off the combo box list.

Any help would be greatly appreciated.
Nov 12 '05 #1
2 6493
rkc

"Jen F." <je****@hotmail.com> wrote in message
news:91**************************@posting.google.c om...
I have inherited a medical database in which there are multiple values
stored in a single field (ie. "Current Conditions" field might contain
1-20 different conditions, separated by comma (ie. "Heart
Disease,Hyper Tyroid,Cancer" etc.

I would like to search via combo box for any one or more than one
value in this field, ie-what patients have Heart Disease or Cancer by
selecting these disorders off the combo box list.


As a recordsource
SELECT * FROM PatientConditionsTable
WHERE [Current Conditions]
LIKE "*" & Me.cboCondition & "*"

or as a saved query
SELECT * FROM PatientConditionsTable
WHERE [Current Conditions]
LIKE "*" & [Forms]![frmConditions]![cboConditions] & "*"



Nov 12 '05 #2
Jen F. wrote:
I have inherited a medical database in which there are multiple values
stored in a single field (ie. "Current Conditions" field might contain
1-20 different conditions, separated by comma (ie. "Heart
Disease,Hyper Tyroid,Cancer" etc.

I would like to search via combo box for any one or more than one
value in this field, ie-what patients have Heart Disease or Cancer by
selecting these disorders off the combo box list.

Any help would be greatly appreciated.

RKC gave you the pointer to do it. Since you need multiple choices, I
would recommend that you create a filter string in your form and I would
not use a combo box. I would use a list box, set the listbox to type
Simple so that you can make multiple selections. Then run thru the list
of selected items. This is aircode but may help you out. I will use
the word ListBox to refer to your listbox name. It assumes column 0
where the name is held CC is current conditions

Sub AirCode
If Me.Listbox.itemsselected.count > 0 then
'make sure something is selected
Dim var As Variant
Dim sf As String 'string filter
for each var in Me.Listbox.ItemsSelected
'create a list of each
sf = sf & "([CC] LIKE *" & Me.ListBox.Column(0,var) & "*) Or "
next
sf = Left(sf,len(sf) - 4) 'remove the word OR
Me.Filter = sf
Me.FilterOn = True
else
msgbox "Please select the condition to check for:
endif
End Sub

You now have the sf string you can use in a query, a form, a report,
whatever.

Please see online help in Access for properties, methods, and functions
you may not be familiar with in the above code.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks....
2
by: CFW | last post by:
I use the following flawlessly to insert a single field: strSQL = "Insert into (Casket) Values " _ & "(" & conQuote & NewCasket & conQuote & ")" Set db = CurrentDb If MsgBox(NewCasket & " is...
2
by: Jen F. | last post by:
I have inherited a medical database in which there are multiple values stored in a single field (ie. "Current Conditions" field might contain 1-20 different conditions, separated by comma (ie....
0
by: rayone | last post by:
Hi folks. I need advice. 2 options, which do you think is the better option to display/retrieve/report on the data. Keep in mind reporting (Crystal), SQL Performance, VB Code, usability,...
4
by: paul.chae | last post by:
I have a table in Access with about 3000 records. There are ~60 unique values in the ID field for the 3000 records. What I would like to do is automatically generate multiple Excel worksheets...
13
by: paquer | last post by:
Ok' I have 2 tables. The first being my main table where each record has a 'FigureID' txt box. (Indexed - No duplicates) The second being my sub table where reporting is entered for these...
1
by: pchadha20 | last post by:
How to single numeric values from a field in a table which has multiple numeric value in a field of a table.And that table contains thousands of records. Suppose we have a table customer having...
5
by: mctime | last post by:
Hello, I am attempting to split a raw data table into a new table that has split out a specific field in the raw data and created a new record for each split but I have come to an impasse due to...
4
4Him
by: 4Him | last post by:
First off, let me say this is a great site! I've just started working with Access and much of my success is from what I've read here! Background: I have a form, driven off a single table. Goal:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.