473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Altering Access to use either tab/return as a delimiter for split() function

Currently I am working on a serial number inventory database. When I was testing functionality, I was using the split function with the space as a delimiter, shown below:

Expand|Select|Wrap|Line Numbers
  1. Dim InputString() As String
  2. Dim i As Integer
  3. InputString = Split(InputName, "    ")
  4. For i = 0 To UBound(InputString)
  5.     CurrentDb.Execute "INSERT INTO InventoryInputT(InputID) VALUES ('" & InputString(i) & "')"
  6. Next i
  7.  
Thus, an entry of
Expand|Select|Wrap|Line Numbers
  1. data1 data2 data3
In the textbox of the form resulted in a table input of

Expand|Select|Wrap|Line Numbers
  1. record1   data1
  2. record2   data2
  3. record3   data3
  4.  
Which is desired. The scanner we purchased uses either a 'tab' delimiter or a 'return'... it can also use 'add jump line' but I don't know what that means and it seems to be similar to return (on the surface)

Is there any way I can alter my code to either:

1) use the tab function
- the issue here is if the data in the scanner is represented as: 'data1 [tab] data2 [tab] data3'

and then I upload that to the textbox, access seems to read the data as:
-input 'data1'
-execute [tab] (which means it navigates out of my textbox to whatever the next button is)
... because it has navigated out of the textbox it can no longer enter 'data2' in the textbox... as such I don't know if this can be solved

2) Can I use the return setup as it allows each data entry to have its own unique line in the textbox
- can I adjust my code so it sets each line of the textbox to a value of i and then runs through my execute code? Example:

data entered (as displayed in textbox):
Expand|Select|Wrap|Line Numbers
  1. data1
  2. data2
  3. data3
  4.  
Get code to read it as:
data1 = line1 = i=0 - execute to table
data2 = line2 = i=1 - execute to table
data3 = line3 = i=2 - execute to table

or something along those lines?

Thank you so much!
May 16 '17 #1

✓ answered by NeoPa

Hi Tyler.

The second parameter of the Split() function is called Delimiter. This can be set to a single space, multiple spaces (as in your example) or even a tab character (vbTab in VBA). It's very flexible.

3 900
NeoPa
32,556 Expert Mod 16PB
Hi Tyler.

The second parameter of the Split() function is called Delimiter. This can be set to a single space, multiple spaces (as in your example) or even a tab character (vbTab in VBA). It's very flexible.
May 17 '17 #2
Thanks NeoPa, I was aware of that usage but the tab didn't seem to work with my system. Turned out it was more of the scanner's issue than it was an error with access.

This was fixed by recognizing all serial numbers started with an 's' which allowed me to use the 's' as the delimiter.
May 24 '17 #3
NeoPa
32,556 Expert Mod 16PB
Good to hear you've resolved your issue anyway Tyler :-)
May 25 '17 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: NewToThis | last post by:
I am trying to use the split function to bread up lines in a file I am reading from. Some lines are working just fine, but a couple of the lines don't split up the way I would have thought. ...
3
by: Reb | last post by:
Hi, I could split only by a character. How do i split by a string. How can i do something like this. e.g., somestring.Split("name"); Thanks Reb
6
by: andrewcw | last post by:
The split function takes as a parameter what I understand as array of Char. I can define the delimiter like this: string innerText = new string; char chSplit={'='};...
2
by: Elhanan | last post by:
hi all.. i have the following string: 200850625~01~464~^^200850625~01~464~^^200850625~01~908~^^ which i will need to turn to a mutli-dimentional string array i used result.Split(new...
8
by: mannyGonzales | last post by:
Hey guys, Earliery I posted this common task of reading a csv file. My data read as: "1","2","3" Unfortunately it now reads as: "1","Text with, comma", "2" embedded commas!...
4
by: vivekgrs | last post by:
hi in vb 6.0 ,iam using space in split function. that is working fine. Split(str, " ") now i want 2 use tab. bcoz in the text file the delimiter they are using is tab. so i want 2 use...
9
by: martinskou | last post by:
Hi, I'm looking for something like: multi_split( 'a:=b+c' , ) returning: whats the python way to achieve this, preferably without regexp? Thanks.
4
by: grey15 | last post by:
hi to all......am very new to perl....so dnt knw much abt it.... i have a txt file.....so i have to split the values using delimiters.eg have following text- Colombian|The finest Colombian beans,...
1
by: John | last post by:
Hi I have written a Split function which in turn calls the standard string split function. Code is below; Function Split1(ByVal Expression As String, Optional ByVal Delimiter As String = " ",...
0
by: handar | last post by:
How do I use Python to split a csv into multiple columns? (using split function using python) "CUSTOMERID","DESCRIPTION","FARE","GUESTS","SEATCLASS","SUCCESS" "1","Braund, Mr. Owen...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.