Solved WHERE on Allen Browne's ConcatRelated module issue. (1 Viewer)

klsblues

Member
Local time
Today, 13:45
Joined
Aug 2, 2023
Messages
33
Hi everyone,

I have hit a brick wall I am going round in circles trying to figure out the correct WHERE part of the Concatenation module from Allen Browne.

I need to Concatenate the Qualifications for each candidate, but the query is returning all Qualifications against each candidate. So for instance, Meryl has 3 qualifications Jennifer has 2, Meg has 5 and so on, but the concatenated field is adding all 10 to each candidate.

I have attached a database with the tables and the query is qryConcatQuals. I haven't put the WHERE bit in, but if someone can help, that would be great.

Kind regards - Kevin.
 

Attachments

  • Database1.accdb
    2.5 MB · Views: 61

theDBguy

I’m here to help
Staff member
Local time
Today, 05:45
Joined
Oct 29, 2018
Messages
21,474
Hi Kevin. On my phone right now so I can't help much at the moment but just wondering if you have seen or tried this simple function?

 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:45
Joined
May 21, 2018
Messages
8,529
I also use the @theDBguy function or roll me own for that specific case. The Allen Browne code ends up being too much work in order to try to be flexible.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:45
Joined
May 21, 2018
Messages
8,529
FYI. I was going to provide the solution but it is not worth it until you get rid of the table lookups. It will make doing this really confusing
If you want a demo get rid of the table lookups and post back. Lookups go in forms and not tables. Why MS thinks this is a good feature, know one knows.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:45
Joined
Sep 21, 2011
Messages
14,311
That is because you are using the incorrect table for the concat?
You should be looking at tblCandQuals for the records. having table lookups does not help the matter? :(

1699019861909.png
 

klsblues

Member
Local time
Today, 13:45
Joined
Aug 2, 2023
Messages
33
FYI. I was going to provide the solution but it is not worth it until you get rid of the table lookups. It will make doing this really confusing
If you want a demo get rid of the table lookups and post back. Lookups go in forms and not tables. Why MS thinks this is a good feature, know one knows.
Hi MajP

I wasn't aware of the issue with lookups - it's all I've ever known. They are integrated into the main database, so I'll have to have a look at it, but i will take your point on board (after reading your link!)

Unless anyone else can help, I'll need to re-think.

Thanks and regards.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:45
Joined
May 21, 2018
Messages
8,529
I fixed it.
qryConcatQuals qryConcatQuals

CandNameQuals
Hugh JohnmanKS1,KS2
James PondKS1,KS2,Mathematics L1,Mathematics L2
Jennifer BannisterKS1,KS2,Mathematics L1
Meg CryinKS1,KS2,Mathematics L1,Mathematics L2,SEND,Sports Degree 324
Meryl SweepKS1,KS2,SEND
Ryan GooslingEnglish L1,KS1,KS2,SEND
Tom FlooseKS1,KS2,Mathematics L1,SEND,Sports Degree 324
 

Attachments

  • Database1.accdb
    2.5 MB · Views: 75

Gasman

Enthusiastic Amateur
Local time
Today, 13:45
Joined
Sep 21, 2011
Messages
14,311
Hi MajP

I wasn't aware of the issue with lookups - it's all I've ever known. They are integrated into the main database, so I'll have to have a look at it, but i will take your point on board (after reading your link!)

Unless anyone else can help, I'll need to re-think.

Thanks and regards.
Did you see my post?
Meg seems to have more than two as well?
1699020746147.png
 

klsblues

Member
Local time
Today, 13:45
Joined
Aug 2, 2023
Messages
33
I fixed it.
qryConcatQuals qryConcatQuals

CandNameQuals
Hugh JohnmanKS1,KS2
James PondKS1,KS2,Mathematics L1,Mathematics L2
Jennifer BannisterKS1,KS2,Mathematics L1
Meg CryinKS1,KS2,Mathematics L1,Mathematics L2,SEND,Sports Degree 324
Meryl SweepKS1,KS2,SEND
Ryan GooslingEnglish L1,KS1,KS2,SEND
Tom FlooseKS1,KS2,Mathematics L1,SEND,Sports Degree 324
Hi MajP

Thank you very much indeed - this and the Grid issue you helped me with is brilliant. As I said, I'll take on board the lookup in tables issue and now it's been pointed out, it does make sense!

Thanks and regards - Kevin.
 

klsblues

Member
Local time
Today, 13:45
Joined
Aug 2, 2023
Messages
33
Hi Kevin. On my phone right now so I can't help much at the moment but just wondering if you have seen or tried this simple function?

Hi DBGuy,

As you can see MajP has solved this for me, but a thank you to you as well - he used your function!

Thanks and regards - Kevin.
 

Users who are viewing this thread

Top Bottom