Modules & VBA :: Multiple Field Entry Separated By Comma
Feb 18, 2014
I would like update a table column values separated by ; For example
1. ColumA has no data, I want to do an update and place a comma at the end
2. If ColumA has already value do not delete add new valued at the end where ; if found.
My start attempt as follow:
Code:
qry_test= "UPDATE Table1 SET ColumA =" & "Enter Entered ;" & & _
" WHERE ID=" & 1
Set RS = cnnDB.Execute(qry_test)
What do I need to do to add more stuff where ; is found without delete existing value if values exist.
View Replies
ADVERTISEMENT
Nov 16, 2013
I have a table like this below:
ProductID ProductName
1 AAA
2 BBB
3 CCC
I have a field in another table, like this:
RelatedProducts
AAA,CCC
AAA
AAA,BBB,CCC
I need a field in one of my queries that will return the related products field data like this:
RelatedProducts
1,3
1
1,2,3
View 8 Replies
View Related
Jun 18, 2013
I'm using Access 2007.
So far I have a Multi Select enabled list on which the user selects the serial numbers they want. They then click the "Report" button which will trigger a query based on the selected serial numbers to create a report on those serial numbers.
I have the code for the multi-select list working already. It creates a string of comma separated values that are the serial numbers which are selected in the list. Somehow I need to pass this string to my query so it can use it as a filter.
Here is some of my code:
Code:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim oItem As Variant
Dim bFound As Boolean
[Code] ....
Here's my current query in SQL:
Then finally how to I get the query to execute and create a report based on all of this?
View 11 Replies
View Related
Apr 30, 2015
I have a list with 50 items in it, I would like to select some of these items by pasting in a coma separated list, is this possible?
View 12 Replies
View Related
Jan 30, 2007
Hi
I'm having a senior moment...
I have a reference field - examples below and need to split into the component parts
example Ref_IDs:
C21/0051,Sheet 18, Sheet 19, E 3, 12/01/07
C21/0052.04, Sheet21 ,E 2
C21/0054, Sheet 23, B 2, 05/01/07
First - ref no, Second - Sheet (note some have more than one), Third - Grid and lastly some have dates, but not all
View 6 Replies
View Related
Apr 28, 2013
I've current got two tables, one with Products and the other with Suppliers. The products table has a column in which I may indicate Supplier IDs that carry the product. I'd like to make a report that groups the Products by the Supplier that carries them and I'm having some trouble. The way I see this working is to relate the Supplier ID found in the Product table with the auto generated Supplier ID in the supplier table.
My trouble is this, when the field is set to text I'm able to enter values separated by commas no problem but I can't report on them because I'd be relating a number to a string. How may I overcome this?
View 7 Replies
View Related
Jul 31, 2014
I have an access table for SampleTests. Each sample may have multiple tests carried out on it. Each test is one record in the access table and a sample may have multiple records therefore depending on how many tests are to be carried out on this sample. I need to create a query that would have sampleID as one of the fields which it gets from the SampleTests table and then I need the second column to have all the tests associated with that sample ID in the format test1,test2, etc. but I cannot see how I can get access to put these records together separated by a comma.
View 5 Replies
View Related
Aug 26, 2013
I have a single 'text' box on a form that captures test scores. The person inputting the test scores puts in all of the scores separated by commas (77, 85, 100, 75.5).. Up to 6 test scores can be placed in this single text box. The field is formatted for text. What I propose to do is take the numbers in the text box and average them out and then display the test scores average in a number field named 'avescores' next to this field in the form. Once the inputer puts the series of scores into the text box, they would hit an 'update' button next to this box to 'update' the 'avescores' box. Right now they use a number pad and add up the numbers manually then place the average into the avescores box....
View 11 Replies
View Related
Feb 11, 2015
I have a field email in the table 2015. I woud create a query that sort my mails separated by a comma. E.G.
123@456.com
456@789.fr
...
Sorted =
123@456.com,456@789.fr, ...
View 2 Replies
View Related
Jan 16, 2014
I use Access 2003. I am trying to populate a list box with the names of files found in specific folder in my computer. The problem is that if the file name has a comma (,) in it, so the name is being separated in two parts - first what is before a comma and second what is after. I need them exactly as they appear in directory in order to open the files from this list box.
View 2 Replies
View Related
Mar 22, 2013
If I have a text box (Text1) on my form with comma separated values entered i.e. 100,120,250,300 what would be the easiest way to enter these into a table column with a button click event. I would like to enter these values into my table tb_test under column Values.
View 7 Replies
View Related
Sep 30, 2011
I created a multivalue list in my table. It contains a list of names and a checkbox. I designed the form based on this and am able to check off multiple names. When I go back to look at the table, it stores in each name separated by a comma. So far so good.
When I create a report to display the data, it displays it as 1,2,3..etc., instead of the names separated by a comma.
What do I need to do to display the names ?
View 5 Replies
View Related
Nov 18, 2014
I am trying to create a list of values in a field separated by commas. I have done this in a query as follows:
[Field1]&", "&[Field2]&", "&[Field3] and so on.
However, when Field2 is null, the result is two commas between Field1 and Field2, but I only need one. What function can I use to eliminate the extra commas when fields used in the concatenation are null?
View 10 Replies
View Related
Oct 21, 2013
I have a field in a table that I'd like to extra the texts from. The are stored in below format (separated by colons). They don't always the same amount of characters and not all of them have the same amount of texts.
Some may only have Text1:Text2::, while some may have Text1:::Text4.
Text1:Text2:Text3:Text4
View 8 Replies
View Related
Oct 24, 2007
Hi.
Stupid question, but I have Access 97 database with ssn in each record.
I need to create a comma-delimted text file with these ssns.
When I use the export text file with a query that lists each record's ssn, it does not produce comma-delimited file.
How?
Russ
View 5 Replies
View Related
May 7, 2014
I'm a new to Access, SQL. I need the following output:
Input:
PHP Code:
PO Vendor State
a, b 1,2 IL
c, d, e 3 TX
f 5 CA
Output:
PHP Code:
PO Vendor State
a 1,2 IL
b 1,2 IL
c 3 TX
d 3 TX
e 3 TX
f 5 CA
I found the following SQL code from another forum, which splits entries in a cell separated by commas into 2 rows, output being:
PHP Code:
PO Vendor State
a 1,2 IL
b 1,2 IL
c 3 TX
d,e 3 TX
f 5 CA
SELECT * INTO ImportedData
FROM (
SELECT PO, Vendor, State
FROM SourceData
[Code] ....
How to run a loop so that if a cell has n entries separated by commas, I want them to be split into 'n' number of rows.
View 3 Replies
View Related
Oct 1, 2012
I have a Comments field on a form. I would like to set it up so that multiple comments can be added and logged at different times by different users. I have attached a picture of what I am looking to do.
View 4 Replies
View Related
Jul 17, 2006
I have a form with a "WorkerID" field. Once the worker enters his ID once, I want the same ID to show up for all the subsequent records so that he doesn't have to type it over and over again. Is there any way to do this? Sorry if I sound totally new to this (I am)!
View 1 Replies
View Related
Jun 18, 2013
Code:
Private Sub CommandButton1_Click()
'Insert database table into document
Selection.Range.InsertDatabase Format:=11, Style:=191, LinkToSource:=False, _
SQLStatement:="SELECT * FROM `tblNoonan`" & "", _
DataSource:="N:TorrentSetupNGS.accdb", _
From:=-1, To:=-1, IncludeFields:=False
End Sub
The code runs and displays like this:
xxxx yyyyyy
xxx yyyyyy
xxx yyyyyy
xxxxxx yyyyyy
xxxx yyyyyy
xxxxxxx yyyyyyy
xxxxxxx yyyyy
xxx yyyyyy
xxxx yyyyy
xxxxxxx yyyyyyy
xxxx yyyy
xxxxxx yyyyyy
xxxx yyyyyy
xxxxxxx yyyyyy
Is there a way to display the table in a single row separated by commas:
View 1 Replies
View Related
Aug 22, 2014
I have a form that users will use to add new records (customers).
There is a field named VAT_Registration_no
First of all i want some code to check for duplicates in that field only,before entering the next field.If the record exists i want to show a msgbox and set focus to the vat_registration_no field. Also I want the same thing to happen if the vat_registration_no field is empty.here is what i have tried:
Private Sub VAT_registration_no_AfterUpdate()
Dim btest As Boolean
If VAT_registration_no = "" Or IsNull(Me.VAT_registration_no) Then
MsgBox "Please enter a Vat Registration No.", vbOKOnly, "error"
Me.VAT_registration_no.SetFocus
Else
btest = True
End If
End Sub
and to all other fields:
Private Sub textfield_Enter()
If Not btest Then
Me.textfield.SetFocus
End If
End Sub
If I just press enter to go straight to the second field I dont get a msg. If I write something and delete it and press enter i get the msg but when I press ok the cursor goes to the next field. I want it to go to the vat_registration_no field again. And I also want this to happen even if dont write something and then delete it.
View 3 Replies
View Related
Mar 8, 2015
how to split this , I am new Access DB, I worked in Sql Server but access new to me
I have the below data
Appid Names
100 John,Bob,Kondya, Lima
200 Shor,James,Kim
300 Cinem
I want to convert to
Appid Names Name1 Name2 Name3 Name4
100 John Bob Kondya Lima NULL
200 Shor James Kim NULL NULL
300 Cinem NULL NULL NULL Null
View 2 Replies
View Related
Aug 11, 2012
I have a few bit fields that, when checked, specific text need to be displayed in a field separated by commas.
Example:
Child 1 = checked
Child 2 = not checked
Child 3 = checked
Child 4 = not checked
Output:
Child 1, Child 3
I did find this sample expression that I am using in another area and it is working perfect and I understand it works based off of string length.
Mid(IIf(Len(Expr1), ", " & Expr1, "") & IIf(Len(Expr2), ", " & Expr2, "") & IIf(Len(Expr3), ", " & Expr3, ""),Len(", ") + 1)
What is the best way to accomplish this?
View 4 Replies
View Related
Dec 6, 2006
I have a csv file which seperates each field with a comma. Now i have some fields that contain comma's within them but they are enclose in quotation marks. How would i import it so that it doesnt seperate these fields?
View 6 Replies
View Related
Jan 25, 2014
Raw data
aaa, bb, ccc, dd
or
aa, bbb, cc
I want field1 to be
aaa, bb, ccc
or
aa, bbb
This drops everything to the right of the 1st comma
field1 would = dd
or cc
Code:
Me.field1 = (Right([field1], (InStr(1, [field1], ",") - 1)))
This drops everything from the 1st comma on the left to the end.
field 1 would = aaa
or aa
Code:
Me.field1 = (Left([field1], (InStr(1, [field1], ",") - 1)))
View 6 Replies
View Related
Feb 27, 2015
I am using Access 2013 and have created a music inventory database.I have a question about formatting some text in a table. One of my tables has the following fields:
tblArtist
Artist ID
DVD Number
Artist Last Name
Artist First Name
Artist Full Name
In my form, I want the artist's name to appear like this:
Mozart, Wolfgang
Dylan, Bob
Beatles
Aerosmith
I know how to format the table to do this, and I know how to construct the form for this. To format the name, in the tblArtist table, I use the following expression in the Artist Full Name field:[Artist Last Name] & ", " & [Artist First Name]
If an artist has only one name, such as Aerosmith, I enter it in the Artist Last Name column. Artists such as The Beatles or The Rolling Stones, I just omit "The."When a one-name artist's full name appears in the form, there is a comma after their name.
Is there a simple way to eliminate the comma if there is no text in the Artist First Name column? If so, what is the simplest, easiest, most practical novice-friendly way to do this?
View 1 Replies
View Related
Dec 14, 2014
I have a form for entry and some fields are computed or result of a query from another table. I have a function that looks up a value from another table like so
************************************************** ********
Public Function GetTargetType() As Variant
GetTargetType = DLookup("type", "tblFormulations", "[tblFormulations!formulation]=Forms![frmNmsConsumptionEntry]![formulation]")
End Function
************************************************** ********
Which works fine when I test in the immediate window.Then I have this form event. This however does not insert this value when I am adding records using my continuous form.
************************************************** ********
Private Sub Form_BeforeInsert(Cancel As Integer)
Me!target_group = GetTargetType()
'Forms!frmNmsConsumptionEntry!target_group = GetTargetType()
'[tblNmsConsumption.target_group] = GetTargetType()
End Sub
************************************************** ********
making sure I can insert this value once retrieved.
View 7 Replies
View Related