Concatenated List

Feb 11, 2008

To make this easier to understand.
I have two tables
Table 1 Table 2
Member (is a number) Member(is a number)
Case (is a number)

A Member may have more than one Case. The Member number is unique while the Member may have many Cases.

I want to create another table from these two called Table 3
In this table I want (in one record, two fields) the Member and all that members cases.

Table 3
Member (one name)
Case(may have more than one number)
The result might look something like this
Member Case
1234 11111,33333,56565,6767

Can somone tell me how to do this?

View Replies


ADVERTISEMENT

Concatenated Query Help

Nov 5, 2004

I have built a query, a series of concatentions. What I need to do is add this query as a field on my form. So that the info that has been concatenated is stored in my table. Can this be done? I am able to show this query field on a report, but I need to pull the concatented info into the table. Hopefully I have explained this well enough.

Sincerely,
Tasha

View 5 Replies View Related

Search By Last/first Name Concatenated

Aug 3, 2007

Hi all,

In the header of my form I have two comboboxes that search the main form to bring up a specific record in the detail section. The first, Combo2, uses the primary key of the table on which the chart is based for the search, and works well. The second, Combo6, is based off of a query that displays patient names concatenated as "LastName, FirstName." I can't search by last name alone because some last names are present for multiple people. Is there any way to take a selection in this combobox and use it as the filter for both the first and last name fields on the main form? Here's my current code for the search:

Code:Private Sub cmdSearchPatientInfo_Click() Dim strWhere As String Dim lngLen As Long Const conJetDate = "#mm/dd/yyyy#" If Not IsNull(Me.Combo2) Then strWhere = strWhere & "([Medical Record Number] = """ & Me.Combo2 & """) AND " End If '====This works fine If Not IsNull(Me.Combo6) Then strWhere = strWhere & "([Last Name] Like ""*" & Me.Combo6 & "*"") AND " End If '====This does not lngLen = Len(strWhere) - 5 If lngLen <= 0 Then 'Nah: there was nothing in the string. MsgBox "You have not entered any search criteria.", vbInformation, "Whoops!" DoCmd.Echo False DoCmd.Close acForm, "editPatientInfo" DoCmd.OpenForm "editPatientInfo" DoCmd.Echo True Else strWhere = Left$(strWhere, lngLen) Me.Filter = strWhere Me.FilterOn = True Me.Detail.Visible = True End IfEnd Sub

I have pretty limited familiarity with VBA, and I'm not really sure how to proceed. Any help would be VERY much appreciated. Thanks!

View 2 Replies View Related

Extracting Concatenated Column Data

Oct 23, 2007

Hi, I need a little help. I will give you the background on what i am doing to hopefully make this easier to resolve. P.S I am open to other approaches.

1) Items are requested for order indervidually

Table/Query looks like this

Code:ID#PartNumberStatusQty ReqOrder StatusNeed DateWork Order110-980-21Stock Required2Waiting26/10/2007WO07-12CR212-5-3Stock Required30Waiting26/10/2007WO07-1310-980-21Stock Required1Waiting28/10/2007WO07-24CR212-5-3Stock Required20Waiting28/10/2007WO07-25CR212-5-3Stock Required15Waiting28/10/2007WO07-2

2) The following Module concatenates the columns (my idea being the user can order all items in bulk.

Code:Public Function Conc(Fieldx, Identity, Value, Source) As Variant Dim cnn As ADODB.Connection Dim rs As ADODB.Recordset Dim SQL As String Dim vFld As Variant Set cnn = CurrentProject.Connection Set rs = New ADODB.Recordset vFld = Null SQL = "SELECT [" & Fieldx & "] as Fld" & _ " FROM [" & Source & "]" & _ " WHERE [" & Identity & "]='" & Value & "'" ' open recordset. rs.Open SQL, cnn, adOpenForwardOnly, adLockReadOnly ' concatenate the field. Do While Not rs.EOF If Not IsNull(rs!Fld) Then vFld = vFld & ", " & rs!Fld End If rs.MoveNext Loop ' remove leading comma and space. vFld = Mid(vFld, 3) Set cnn = Nothing Set rs = Nothing ' return concatenated string. Conc = vFldEnd Function

3) A query calls on this

Code:SELECT Conc("ID#","PartNumber",[PartNumber],"Qry_70_BOM_Awaiting_Order") AS [BOM ID#], Qry_70_BOM_Awaiting_Order.PartNumber, Sum(Qry_70_BOM_Awaiting_Order.[Qty Req]) AS [Total Qty Required], Conc("Work Order","PartNumber",[PartNumber],"Qry_70_BOM_Awaiting_Order") AS WOrdersFROM Qry_70_BOM_Awaiting_OrderGROUP BY Qry_70_BOM_Awaiting_Order.PartNumber;

Producing this result.

Code:BOM ID# PartNumberTotal Qty RequiredWOrders1, 3 10-900-213 WO07-1, WO07-22, 4, 5 CR2162-5-365 WO07-1, WO07-2, WO07-2

OK, Now after that, (ALL ABOVE WORKS FINE).

I would like my users to purchase againts the new BOM ID# records as seen above. Once a order is placed against these i will, put something against each records to show there order status. (i'll take care of this part.)

Code:BOM ID# PartNumberTotal Qty RequiredWOrders Order Status1, 3 10-900-213 WO07-1, WO07-2 Waiting2, 4, 5 CR2162-5-365 WO07-1, WO07-2, WO07-2 Ordered

Finally, sorry about the lenght of this, I need to be able to use the above BOM ID# to reference back to the the ID# table at the start of the thread. In this example Id's records 2 - 4 and 5 will show ordered.

In other words how do i extract 2, 4, 5 back out of the above and into there original state, but including the order status?

Hope this makes sence

View 1 Replies View Related

Splitting Records Based On Concatenated Strings

Dec 14, 2007

Hello all

I have a table containing the following fields:
Customer ID
Customer Name
Countries
The ID is numeric, the name is a string and the countries are the tricky bit since it contains a string of concatenated 2 digit ISO codes: "USCAGB".

What I would like to do is convert the concatenated representation to a normalized one. Take this example table:

ID Name Countries
2 John SEDK
3 Maria USCAGB

From the above table I would like to create a new table that links Customer IDs to single countries as

ID Name Countries
2 John SE
2 John DK
3 Maria US
3 Maria CA
3 Maria GB

How would I go about solving this?

View 4 Replies View Related

Queries :: Multi Concatenated Text Box To Individual Row

Sep 30, 2014

I have imported a lot of data from excel into a table. There is in one of the columns some multi concatenate info I want to separate in it's own individual row.I am not sure if there is a way to do this in a query or if there was an MsAccess2007 example somewhere. I looked on the internet but couldn't find anything.

the columns are like this now

123456 7RFE01, 7RFE03, 7MFE06, 7MFH04
237890 8RFE80, 8MFE03, 9GFE06, 5QFH06, 3QFY06

I want the columns to be like this in a query or new table.

123456 7RFE01
123456 7RFE03
123456 7MFE06
123456 7MFH04
237890 8RFE80
237890 8MFE03
237890 9GFE06
237890 5QFH06
237890 3QFY06

View 5 Replies View Related

Query Is Re-organizing Data In A Concatenated String

Jan 11, 2012

I'm putting together a shipping database. We scan in a string of barcodes, separate out the Serial Numbers from the Barcode Data, concatenate them together as a string with asterisks as a delimiter and join them together with a date code and manufacturing line identifier. Throughout all of the data manipulations I am able to maintain the Serial Numbers in my table in the order which they were scanned in. The very last function is to concatenate the Serial Numbers and Lot information together into one long string which will then be output to a label creation software. And up to that point, the Serial Numbers are still in the correct order (based on them being linked to an autonumber field in the initial table) Upon the final concatenation, the order of the Serial Numbers is being changed, sometimes 17 out of 18 Serial Numbers will be correctly ordered with just one being randomly placed in the string out of order. Here is the code in SQL that I use for concatenating.

INSERT INTO tempMotorPalletLabel ( PalletLabel )
SELECT DISTINCT tempMotors_to_Warehouse.PalletNumber&"*"&tempMotor s_to_Warehouse.Count&"*"&tempMotors_to_Warehouse.P artNumber + '*' + Replace(Replace(ConcatRelated("SerialNumber","temp Motors_to_Warehouse","PalletNumber='"&PalletNumber &"'"),' ',''),',','*')
FROM tempMotors_to_Warehouse;

And this SQL Query transfers the concatenated string to a table that my Label Software queries for data to create the label with.

INSERT INTO AccessMotorLabelData ( PalletNumber, [Count], PartNumber, PalletLabel )
SELECT DISTINCT tempMotors_to_Warehouse.PalletNumber, tempMotors_to_Warehouse.[Count], tempMotors_to_Warehouse.PartNumber, [tempMotorPalletLabel].PalletLabel
FROM tempMotors_to_Warehouse INNER JOIN tempMotorPalletLabel ON tempMotors_to_Warehouse.PalletLabel=[tempMotorPalletLabel].PalletLabel;

View 14 Replies View Related

Concatenated Fields And Writing To Original Table

Nov 3, 2014

I concatenated 2 fields CR_Numbers: = CR_Number & [Sub Number] to display 12.01: from 12 and 1. I am now wanting to lookup the CR_Numbers to edit or add information into other fields.

I want to use a pop up form to edit/add data without having the form add an entire row to the table. How do I reference the Table ID so that it will go to the equivalent row to add the data in?

Main Table = Change Request
Email Table = AORB_Email
Fields in Form!AORB_EMail: Change Request (CR_Numbers), Priority (Pri_Name), Hours (Hour)

I plan on using the Priority and Hours in the email to set some dates and expiration times as well as in the subject of the email. I have figured out the email setup, and if I manually fill in the Priority and Hours fields everything works as it should.

View 14 Replies View Related

Make Table Queries And Concatenated Memo Fields

Jul 13, 2006

I have a Make Table query that includes a new field concatenated from a numeric field and a memo field, with some assorted text elements -
Issue Description:"("&[number]&") "&[Description]

When I run the Make Table, the new field "Issue Description" is created as a text field, NOT as a memo field.

Is there any way to insure that this field is created as a memo field.

Thanks.

Susan

View 1 Replies View Related

Tables :: Update Table Based On Concatenated Field

Aug 8, 2013

I have a field in a table that is to be concatenated from two other fields, PolPrefix and PolNum. On a form I got it to show the full field 'PolicyNumber' by making the control source =[PolPrefix] & [PolNum].

But this doesn't update the field PolicyNumber in the respective table, and only shows it on the form. How do I get a concatenated field defined by the user into a table so that I can call that field other places in the database?

View 3 Replies View Related

Queries :: Slow Query Filtering On Concatenated Variable

Jul 9, 2015

I am trying to use a criteria to filter out nulls in concatenated variable, which slows the query considerably.The part that makes it slow looks like this -

WHERE ... AND (([tbl1].[x] & [tbl1].[y]) <> "") AND ...

If I work them individually, it's not a problem, the query is fast, but I have to combine them first in order to produce the correct output.

View 13 Replies View Related

General :: How To Create Printed Label With Concatenated Field

Feb 25, 2013

I am attempting to create a printed label with a concatenated field. I want the field to abbreviate several shapes and colors but i will just start with the shape.

=IIf([Shape]="round","RD","TH")

This is what my basic statement says. I am attempting to nest other options inside of this.

=IIf([Shape]="round","RD",IIF([Shape]="oval", "OV", IIF([Shape]="triangle", "TR", "TH")))

Is this the correct syntax? I can not seem to get it to work.

View 7 Replies View Related

How To Make Calculated / Concatenated Text Field Unique

Feb 12, 2014

I have a calculated field which consists of a few other fields concatenated, i.e. [field1] = [field2] & [field3] & [field4].

I need field 1 to be unique when its concatenated, but fields2-4 don't need to be unique. Is there a way to do this?

View 3 Replies View Related

Reports :: Class Roster - How To Sort Concatenated Fields On A Report

Mar 16, 2015

I have a class roster report in which the Employees' names are concatenated in a text box. When I select to sort the concatenated names alphabetically, it is sorting by the Unique ID, which is a letter and four numbers. The letter used to match the last name, but newer IDs are random. So most names are still in order, but some are not.

The Employee field Row Source is:

SELECT [Last_Name] & ", " & [First_Name] AS Employee, tbl_AM_Operators.User_ID FROM tbl_AM_Operators ORDER BY [Last_Name] & ", " & [First_Name];

What do I need to change to have the Employees' names alphabetized on the report?

View 8 Replies View Related

Forms :: Place Values Of A Concatenated Combobox In Respective Fields

May 15, 2013

I have a form in which I have a combobox. The code in the row source is:

Code:
SELECT [tblBooks].AuthorFirst & " " & [tblBooks].AuthorLast AS Expr1 FROM tblBooks GROUP BY tblBooks.AuthorLast, tblBooks.AuthorFirst HAVING (((tblBooks.AuthorFirst & " " & tblBooks.AuthorLast)<>"") And ((Count(*))>1)) ORDER BY tblBooks.AuthorLast, tblBooks.AuthorFirst;

This is an unbound box.

The rest of the form contains bound textboxes and other bound comboboxes.

This form is processed by the following VBA code:

Code:
Private Sub cmdAddBook_Click()
'Place the authors first and last name in an array
splitAuthor = Split(cboAuthor.Value, " ")
'Create a new record with the form information
DoCmd.GoToRecord , , acNewRec

[Code] ....

What happens is that it places all the records (Except those in the array) in a field and overwrites the values in that field.

I have used the same GoToRecord statement on other databases and it works just fine. I suspect that it is due to the unbound combobox.

What I need to find a way to place all the data in the corresponding fields of a new record including separating the author's first and last name when retrieved from the combobox. I just need to figure out how to get the data in the table somehow.

View 2 Replies View Related

Forms :: Sort Concatenated Field - Runtime 2046 Error

May 13, 2013

I am trying to sort with Docmd.Runcommand acCmdSortAscending

When it tries to sort a concatenated field i am getting the runtime 2046 Error

Code:

Private Sub cmbSort_AfterUpdate()
Select Case cmbSort

Case 1
Me.CompanyName.SetFocus
DoCmd.RunCommand acCmdSortAscending

Case 2
Me.DateCreated.SetFocus
DoCmd.RunCommand acCmdSortAscending

Case 3
End Select

View 3 Replies View Related

Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View 5 Replies View Related

Create A Randomise List From A Table And Save The List For Each Month

Dec 14, 2006

Hi All a newbie here so any help will be appreciated,

sorry for the long post but trying to give you all the information you might need.

I wrote a basic access database for my Church to aid in a paperwork audit for a charity food drop which we do monthly to give free food to the needy.

But each month it gets harder to find out who was in line first so I thought with all your help we may be able to randomize the names each month in a different order as to avoid confusion and also avoid people waiting in line as they turn up at 5am and we don't start until 9am.

So if this will work in access they can all come for 9am

I don't mind creating a new database and adding the additional information, if that's what it would take.

My Background I have created basic databases from scratch not using wizards, But I don't know much about code or how to implement it so any help in where code goes it would be very much appreciated.

Database details (Microsoft Access 2002 version)

Table Name = details
Field name = ID (auto-generated)
Field name = FirstName (text)
Field name = Surname (text)

If possible it would be nice to keep a record of the randomized lists (in the database somewhere ?) each month in case anyone wants to see it or disputes the lists, where I can just create a report to show the details.

There will be approximately 90 to 125 names.

Thank you in advance for all your help in this matter

Britgent

View 1 Replies View Related

Reports :: Exclude Individuals From False List If They Are In True List

Jul 15, 2013

I have created my tables and form and am now trying to run reports to organize the data. I have figured out how to group the individuals by group and treatment, but can't figure out how exclude individuals from the final list if they are already in another. As background, some of the individuals are eventually excluded from the experiment, though I keep the initial data. When the exclude individual checkbox is checked ("True" on the report) I do not want the individual to be listed in the "False" list, even though there are entries for that individual when that checkbox wasn't checked (when it was "True"). This is so I can get an idea of the current totals in each group.

Implant Period
>Treatment
>>Exclude individual?
>>>Individual ID

I feel like this should be a fairly simple task, but I cannot figure it out... Maybe there is coding to exclude individuals from the "False" list if they are already listed in the "True" list?

View 4 Replies View Related

Use Multi-select List Box To Filter A Report With Two List Boxes

Nov 20, 2013

Allen Browne's "Use a multi-select list box to filter a report" solution, in particularly with two multi-select list boxes? The code works fine for me for either box so long as I code it for one box alone. Combining the two into one code results in a type mismatch error. I'm trying to use the code to pass the contents of both multi-select boxes as Where conditions to a report. Both boxes are based on number fields. To try to isolate the problem, I've removed Allen's setDescription and OpenArgs conditions. We're unfortunately still on Access 2003 as the company desires to squeeze every dime by using until end-of-life next year.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_Handler
'Purpose: Open the report filtered to the items selected in the list box.
Dim varItem As Variant 'Selected items

[Code] .....

View 14 Replies View Related

Created List Box With One Column - Display All Characters Of List Item

Jan 2, 2014

I have created listbox with one column (contains one column only), now i would like to display all the characters of list item (want scroll bar to listbox).

How do i display all text of list item, I have already fixed Column Widths to max length (22";0.1"). However when scrolling to right, it is going to next blank column of list box, which is created only to change Column Widths property.

View 12 Replies View Related

Queries :: Return List Of Records From Original List

Apr 23, 2013

I'm looking to move an excel sheet to access because the row counts are too much.The main thing it does is compare the supplied data against a list I hold in the sheet.There are not duplicate records, however..Some data is a direct lookup for a full match, but much of it is a count to see how many records contain a certain string.

I have 500 keywords which have a countif function in using wildcards.I need to create a query/report which will return a list of records from the original list which contains each keyword featured and how many times it features.I was going to do it in PHPmysql but the time it took to parse a million records for every keyword made it pointless.

eg:
keywords:
look
billy
magic

list:
"have a look and see"
"spanish dave"
"who is billy brag"
"looky looky I go hooky"
"who's the man from argentina"
"could it be magic now"

my spreadsheet would return a 1 next to ""billy" and "magic" and would put a 2 next to "look".

the sheet has the keyword in each row and next to the column:
=COUNTIF(list,CONCATENATE("*@",B13))
where "list" is the external data.

View 3 Replies View Related

How To Transfer Multiple Select Item In List Box To Another List Box

Jun 2, 2012

How To Transfer MultipleSelect Item In Listbox to another Listbox ?

View 7 Replies View Related

Select From List BOX Of List Of Choices And Store This Into A Table

Aug 21, 2013

I created a form and created on it a list box which is a query that grabs certain number of fields from different tables. I would like the user to select from this list box of a choice and then store their selection into a table.This list box has three fields, but it needs to store the id rather than the item, the user would see the name of the item but the id of the item would be store into another table, called bid. It store all these three fields when a user selection one of the item from the list.

View 13 Replies View Related

List Table, Limiting Field List..

Oct 14, 2006

Okay,

The subject is probably confusing but I'll try to explain.
Setup:

Table1
FieldID = Number
FieldName = Text

Table2
FieldID = Number
FieldName = Text
T1_ID = Number

Relationship
Table1.FieldID 1-> * Table2.T1_ID (one to many)

Now, I'm trying to create a 3rd table that has field populated by Table1 and a field populated by Table2 but I want to limit the field populated by table2 by what is selected in the field populated by table1.
Table1:

1st
2nd
3rd
4th

Table2:

1st,January
1st,February
1st,March
2nd,April
2nd,May
2nd,June
3rd,July
3rd,August
3rd,September
4th,October
4th,November
4th,December


Table3:
Table1Field = Number, ComboBox-Source: Table1, BoundColumn=1
Table2Field = Number, ComboBox-Source: Table2, BoundColumn=1

If Table1Field = 1st then
Table2Field Will only allow January, February, or March as selections, since ONLY they are a member of the "1sr" group via the table1 list.

Is this possible, or do i have to do some run-time checking or something?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner

View 1 Replies View Related

Forms :: List Box - Selection - Populates Next List Box

May 20, 2013

I am wanting to preempt data in list boxes

listbox1
Fruit
Vegetable

listbox2 (If Fruit Is Selected)
Apple
Banana
Orange

listbox2 (If Vegetable Is Selected)
Potato
Peas
Carrot

If Fruit is selected in Listbox1 - Then Listbox2 should have the options
Apple
Banana
Orange

If Vegetable is selected in Listbox1 - Then Listbox2 should have the options
Potato
Peas
Carrot

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved