How can I see the contents of a multivalue field on a form?

gpeirce

Registered User.
Local time
Today, 12:51
Joined
Sep 24, 2015
Messages
22
I have a multi-value field on a form that I want to examine. I would like to see if my field (that I called Forms!FrmVisitAdd.Holidays has a certain word in it.

Is there one field I can examine to check that? i.e. Let's say the box choices are:
New Years Day
Mothers Day
Christmas
Boxing Day

If the data operator chose Mothers Day and Christmas, the box in the form wouid say:

Mothers Day, Christmas



I want to see if "Christmas" was one of the choices. I would like to code something like:

If FrmVisitAdd.Holidays like "*Christmas*" then.....

So, is there one field that will show me the contents of the multivalue box?

Thank you, and Happy New Year.
 
This is why multi-value fields are such a pain in the toches. I never used them because of the awkwardness of trying to deal with multiple values.
 
I know there must be a way and someone must know. I'm looking at the &^%*$( box on the screen right now and it's laughing at me.
 
Multi items are shown as data sheets.
Single items are shown in a textbox.
 
Thank you, Ranman. Can I see what is in the data sheet?
 
If you look at the field in a query you'll see it has a linked sub field that holds all of the values.

Code:
fnd = "christmas"
ValueSelected = Not CurrentDb.OpenRecordset("select holidays.value from YourTable where id=" & Forms!FrmVisitAdd!id & " and holidays.value like '*" & fnd & "*'").EOF

If ValueSelected Then
    MsgBox "found"
Else
    MsgBox "not found"
End If
 
Thank you. That almost worked on the first try but the results were inconsistent. However, if I saved the record first to the table, then issued your command, it worked like a charm!!

I had seen web references where you can just look at the field holidays.text but that was a complete misnomer.

I thank you again and again.
 

Users who are viewing this thread

Back
Top Bottom