0

I've searched a lot of forums but can't find the exact answer I need.

My db is a Conference Scheduling DB whereby I have four tables to consider: Persons / Person-to-Conference / Conference_Main / Conference_Day

I am unable to post images because when I try to do so on my work computer, it craps out, so I'm sorry for the lack of visual.

This db will allow someone to create a conference, where it will automatically populate data for Day 1. Not all conferences are multiple days, but some are.

Let's say there's a three-day conference (Conference X), and it's attended by three people (A, B, C).

Person A is going Day 1
Person B is going Day 1 & 3
Person C is going Day 2 & 3

I have a query where I want to show what days of the conference people attended and I want to populate a textbox on a form with that information. Is there a simple concatenation I can do, or do I need a For Each loop, because of the question of whether or not a conference will even have multiple days or not?

I want to see something like this:

Attendee   Days Attended
Person A   1
Person B   1, 3
Person C   2, 3

*Note "Days Attended" would be the textbox in question where I'd want to see the multiple values, e.g. "2, 3"

I'd rather not store this in another table, but rather just make it Dynamic based on whatever days I know my person is going to for the conference. Can anyone help me with some vba?

Or should this instead be a Query that will concatenate the Days attended? Is that possible?

My answer has nothing to do with it being entered in correctly (it is), but rather is a question of where I should be calling the variable arguments for the WHERE statement.

Will Dutcher
  • 339
  • 1
  • 4
  • 11

2 Answers2

1

I received a ton of help here: AccessForums which made reference to this post on AllenBrowne.com. Thank you to all that helped!

Will Dutcher
  • 339
  • 1
  • 4
  • 11
1

Someone helped me with my WHERE statement from that AllenBrowne.comblink. It needed to look something like this:

I needed to add this to the control source of the textbox: =ConcatRelated("Day", "qry_PerToConfByDay", "PersonID=" & [PersonID] & " AND Conference ID=" & [ConferenceID]

Whereby:

Start of Function is: ConcatRelated(

Field I want to see all values is: "Day",

Table (or in this case the Query) I want to pull the data from: "qry_PerToConfByDay",

Where criteria, setting up which fields I want to pull from: "PersonID=" & [PersonID] & " AND ConferenceID=" & [ConferenceID]

End the function: )

I didn't need to do an ORDER BY nor did I need to change my delimiter, so the last two arguments I didn't put in. But that's what worked for me.

I hope this is helpful to someone else!

Will Dutcher
  • 339
  • 1
  • 4
  • 11