I am creating a database for inputing ambulance run sheets. I have a table that lists different history conditions (HTN, CHF, Asthma....) In my main report form, I have a combo box that gets its' list from that table.
I want to be able to select from the list and then hit a command button next to it that adds the current data to another field, labeled history. I then want to be able to make another selection from the same combo box and add to that same history field without erasing what was there. If it's possible to add a comma between the selections, that would be beneficial too. I could live with spaces, which could be added in the original table.
So, the final field value would end up having multiple history data in one field, looking something like this------- Asthma, CHF, HTN,
I have figured out how to copy data from one field to another with the Me.xxx1 = Me.xxx2 script, but that overwrites what was there. I want to keep the current data and add to the list.
I'm sure this is possible, but have not been able to find info on how to accomplish this. I appreciate any help that can be given.
Thank you!!
Mike Busby
10 4072
This should do it: - Private Sub YourComboBox_AfterUpdate()
-
If IsNull(Me.History) Then
-
Me.History = YourComboBox
-
Else
-
Me.History = Me.History & "," & YourComboBox
-
End If
-
End Sub
Welcome to TheScripts!
Linq ;0)>
That's not a good design for it however. You should have a another table that is related to this table that lists the illnesses for each person in a separate records.
It really depends on what you're using it for, Rabbit. If you're going to want to manipulate the data, i.e. calculate how many patients with Asthma are transported, how many with COPD, etc. then yes, you'd be better off doing as you say. If the only point is generating a report of a single ambulance run, then a memo field box is just fine and what you suggest is overkill.
Linq ;0)>
It really depends on what you're using it for, Rabbit. If you're going to want to manipulate the data, i.e. calculate how many patients with Asthma are transported, how many with COPD, etc. then yes, you'd be better off doing as you say. If the only point is generating a report of a single ambulance run, then a memo field box is just fine and what you suggest is overkill.
Linq ;0)>
True, it would be overkill. I just like to plan for the worst. You just know someone's going to ask for that information at some point.
But if everybody planned ahead, we would have just passed our 6ooth post, instead of our 60,000th post!
Linq ;0)>
This should do it: - Private Sub YourComboBox_AfterUpdate()
-
If IsNull(Me.History) Then
-
Me.History = YourComboBox
-
Else
-
Me.History = Me.History & "," & YourComboBox
-
End If
-
End Sub
Welcome to TheScripts!
Linq ;0)>
I will try this code when I get back to work. If things go right, I will not return for another week.
I wouldn't expect that we would run a report on past medical illnesses, so this should be perfect. If we ran a report, it would be off of what the current illness is, and that would be another field (Chief Complaint) with a single entry.
Once again, I appreciate the feedback.
I hope you all have a Merry Christmas and Happy New Year.
God Bless!!
Mike Busby
I will try this code when I get back to work. If things go right, I will not return for another week.
I wouldn't expect that we would run a report on past medical illnesses, so this should be perfect. If we ran a report, it would be off of what the current illness is, and that would be another field (Chief Complaint) with a single entry.
Once again, I appreciate the feedback.
I hope you all have a Merry Christmas and Happy New Year.
God Bless!!
Mike Busby
That's what you think. $5 says someone will want that report within a year. Good luck though.
Having run with volunteer and professional EMS agencies, in my youth, I suspect you're right, Mike, and chief complaints would be all anyone would be interested in! If you included all Dx the forests would be in more danger than there already are!
Have a great holiday!
Linq ;0)>
This should do it: - Private Sub YourComboBox_AfterUpdate()
-
If IsNull(Me.History) Then
-
Me.History = YourComboBox
-
Else
-
Me.History = Me.History & "," & YourComboBox
-
End If
-
End Sub
Welcome to TheScripts!
Linq ;0)>
I used this code and it works great. I wanted to thank everyone for their input. It's sites like these that make the internet so valuable.
Mike
Glad we could help!
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robin S. |
last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope
I've done a better job of explaining myself below.
I am trying to produce a form to add products to a table (new...
|
by: 6thirty |
last post by:
Hi,
I've created a stocktaking database using Access XP. This is indexed by two
fields - part number and shelf location.
I am currently inputting all the data via a form. When I have entered a...
|
by: Nhmiller |
last post by:
When I start to type the data for a new record, I would like a dropdown box to
open next to it from which I can choose the data from a previously entered
record that starts with the same letter....
|
by: MS |
last post by:
What's the best way to "store" and display a value in a text box that
changes from day to day. An example of this would be where the name of the
user is manually typed in after using the datbase,...
|
by: meganrobertson22 |
last post by:
hi everybody-
what is the best way to add data from one form to another?
i have 2 tables: person and contract. here are some of the fields.
table: person
personid (autonumber and primary...
|
by: ILCSP |
last post by:
Heello, I'm using Access 2000. I have a form with a combo box that has
a query as its row source and it's bound to column 1. This combo box
is unbound to a record like the rest of the form...
|
by: imwhiteandnerdy |
last post by:
i'm hoping I can get some help with adding my combo box selection to my access database.Any Help would be appreciated.
I've been told I need complex binding Basically I just want to add the...
|
by: vljones |
last post by:
Hoping to find a way of entering new data into a combo box which contains a list of items contained in a table.
In addition I want to allocate an ID number to entries that are not currently in...
|
by: beacon |
last post by:
Hi everybody,
I've searched and searched for the answers to these questions until I've turned blue in the face, so I finally decided to come here for some assistance.
Here's the info I'm...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |