One to Many help?

brandon20

Board Regular
Joined
Feb 12, 2014
Messages
203
Hi,

Im sure this is simple. But I am new to access and dont even know the correct wording to look up my question on the internet.

Lets say I have two different sheets linked together in access.

One sheet displays the data like this:

Wellname Current Status Reservoir Code
A OPEN ZZ
A OPEN BB
A OPEN CC

I need the data to be displayed concatenated in one cell. So I guess maybe a One to Many relationship

I need the data to be displayed like this:
Wellname Current Status Reservoir Code
A OPEN ZZ-BB-CC

How would I do this?
I found some VBA code I guess, but it didnt help that much.
Microsoft Access tips: Concatenate values from related records




Thanks for any help
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
How would I do this?
I found some VBA code I guess, but it didnt help that much.
Microsoft Access tips: Concatenate values from related records

The code in the link is exactly how you would do it.

"Lets say I have two different sheets linked together in access."
I think you mean tables not sheets (in an excel workbook).


I will assume the table:

tblWells - priamry key is Well ID (auto-number)
tblWellResivors (has foreign key WellID (long))

Wellname Current Status Reservoir Code

Something like:

Code:
ConcatRelated("Reservoir Code", "tblWellResivors", "WellID= " & tblWells.[WellID] " and [Current Status] ="& Chr(34)  & tblWellResivors.[Current Status] & Chr(34) )
 
Upvote 0

Forum statistics

Threads
1,221,840
Messages
6,162,311
Members
451,759
Latest member
damav78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top