i'm developing an equine massage database for my partner. she's bought a databse program off the internet, but it was
developed in 2002 and is VERY out of date (e.g., doesn't have fields to store owner's email address), plus is not as
functional as we'd like, nor is it very comprehensive.
i have quite a lot done, but have also hit walls with a lot! i'm going to try and nut it all out in due course, and try one
thing at a time (i find i can often learn how to do one thing while figuring out another thing).
there's one section, where i have a listbox of muscles. this listbox is populated from a table of muscles with several
columns, although i have only one column showing in the listbox.
what i have so far is when i double-click on any muscle from the listbox, another column from that table populates a memo
field. however, if i double-click another listbox item, it replaces the item that was there before instead of adding itself
to the end of the memo field (after the item that was there before).
i prefer the double-clicking to multiple-select-then-press-command-button because i feel it would be easier to dblClick
additional muscles in case not all items are selected the first time (missed one accidentally, for example). If it's possible
to do BOTH, then i suppose that's the ultimate in end-user friendliness, HOWEVER, at the moment i'm jsut interested in
getting the thing to work at all!
The idea is to allow my partner to select muscles from the listbox and then customise the text for each massage session,
which will then be printed to a report to give to the horse owner.
Something else related to this (i expect i can figure this out if i figure out my problem as explained above) is i have
another listbox of massage techniques ( setup similarly to my muscles listbox) which i also want to be able to append to the
same memo field.
So, in the end, the memo field will be populated with: So-And-So muscle, This muscle, That muscle were tense so i used
such-and-so technique to relax the muscles and improve the circulation.
i know it MUST be possible to do this, i just can't get the VB code right. i've been trying so many different things, but
seeing as i'm a newbie, i'm not surprise i haven't cracked it yet.
There is no urgency for this to be completed in the following days, so please don't anyone break their backs trying to rush
me an answer!!
As usual, the VB Help was completely useless!!
This is the code i have for one of these listboxes, i did lift the code from another post on this forum, so i'm not sure what
all the variables etc mean (eg, why "trim"? - i suspect this has something to do with my problem? as you can see, i've tried
to comment that line out, but it doesn't actually change the result, so i'm not sure what it's there to do! i also added a
new line (vbCrLf) because i wented to be better able to see the code work, which it didn't! ho hum):
Private Sub ListMuscle_DblClick(Cancel As Integer)
Dim varItem As Variant
Dim strMassageMuscle As String
For Each varItem In Me.ListMuscle.ItemsSelected
strMassageMuscle = strMassageMuscle & Me.ListMuscle.ItemData(varItem) & vbCrLf
'strMassageMuscle = Trim(strMassageMuscle)
Me.MassageMuscle.Value = strMassageMuscle
Thank you so much in advance for looking at my problem. Sorry about the long winded nature of my description, but i
figure if you know what i want, and what i have, and who it's for, perhaps the solution can be more elegant.