473,396 Members | 2,014 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,396 software developers and data experts.

Splitting user input into multiple fields

Hi,

I'm ridiculously new to Access (about a week!) so please be patient!

My database is a record of British Standards. Each has a unique
identifier. Some are split into parts. I would like the user to be
able to input the data into a single textbox using a form like this:

Record1: BS 1490-1
Record2: BS 1490-2
Record3: BS 1495 [this is one that isn't split into parts]
etc...

and for Access to place these records into a table splitting each
record into two fields, "Standard" (text) and "Part" (Long int) as
below:

Standard | Part
BS 1490 | 1
BS 1490 | 2
BS 1495 |

or maybe with "0" in the part column for BS 1495.

Is there a way of getting Access to split the user input into two
fields using the position of the hyphen to govern where (or whether) to
split?

I can ensure that the user always uses a hyphen to delimit (maybe with
an input mask).

Thanks in advance for any help you can give me,

Matt.

Jul 20 '06 #1
2 2848
Study event functions. Use the after update event with the built-in string
functions, instr, len, mid, left, right to split your text and add it to the
fields.

Air code

me![Standard] = left(me![input],instr(1,me![input],"-")-1)
me![Part]=right(me![input],len(me![input])-instr(1,me![input],"-"))

if me![Input] is "BS 1490-1"
Me![Standard] would be "BS 1490"
Me![Part] would be "1"
"Matt" <ma************@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hi,

I'm ridiculously new to Access (about a week!) so please be patient!

My database is a record of British Standards. Each has a unique
identifier. Some are split into parts. I would like the user to be
able to input the data into a single textbox using a form like this:

Record1: BS 1490-1
Record2: BS 1490-2
Record3: BS 1495 [this is one that isn't split into parts]
etc...

and for Access to place these records into a table splitting each
record into two fields, "Standard" (text) and "Part" (Long int) as
below:

Standard | Part
BS 1490 | 1
BS 1490 | 2
BS 1495 |

or maybe with "0" in the part column for BS 1495.

Is there a way of getting Access to split the user input into two
fields using the position of the hyphen to govern where (or whether) to
split?

I can ensure that the user always uses a hyphen to delimit (maybe with
an input mask).

Thanks in advance for any help you can give me,

Matt.

Jul 20 '06 #2
Excellent. That should point me in the right direction. Thanks for
the help.

Matt.

paii, Ron wrote:
Study event functions. Use the after update event with the built-in string
functions, instr, len, mid, left, right to split your text and add it to the
fields.

Air code

me![Standard] = left(me![input],instr(1,me![input],"-")-1)
me![Part]=right(me![input],len(me![input])-instr(1,me![input],"-"))

if me![Input] is "BS 1490-1"
Me![Standard] would be "BS 1490"
Me![Part] would be "1"
"Matt" <ma************@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hi,

I'm ridiculously new to Access (about a week!) so please be patient!

My database is a record of British Standards. Each has a unique
identifier. Some are split into parts. I would like the user to be
able to input the data into a single textbox using a form like this:

Record1: BS 1490-1
Record2: BS 1490-2
Record3: BS 1495 [this is one that isn't split into parts]
etc...

and for Access to place these records into a table splitting each
record into two fields, "Standard" (text) and "Part" (Long int) as
below:

Standard | Part
BS 1490 | 1
BS 1490 | 2
BS 1495 |

or maybe with "0" in the part column for BS 1495.

Is there a way of getting Access to split the user input into two
fields using the position of the hyphen to govern where (or whether) to
split?

I can ensure that the user always uses a hyphen to delimit (maybe with
an input mask).

Thanks in advance for any help you can give me,

Matt.
Jul 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary Lynch | last post by:
I am looking for a simple solution to a recurrent problem with imported data in Access 97. The example below is a simplification of a problem with a much larger database. Let's say I start out...
2
by: Trint Smith | last post by:
Ok, My program has been formating .txt files for input into sql server and ran into a problem...the .txt is an export from an accounting package and is only supposed to contain comas (,) between...
20
by: Opettaja | last post by:
I am new to c# and I am currently trying to make a program to retrieve Battlefield 2 game stats from the gamespy servers. I have got it so I can retrieve the data but I do not know how to cut up...
4
by: The Facilitator | last post by:
Well, Outlook seems to be making my life more and more challenging. Categories are added in one field and are delimmited via comma. Have three questions on this one... The first is right now...
5
by: mctime | last post by:
Hello, I am attempting to split a raw data table into a new table that has split out a specific field in the raw data and created a new record for each split but I have come to an impasse due to...
9
by: conspireagainst | last post by:
I'm having quite a time with this particular problem: I have users that enter tag words as form input, let's say for a photo or a topic of discussion. They are allowed to delimit tags with spaces...
15
by: nagar | last post by:
I need to split a string whenever a separator string is present (lets sey #Key(val) where val is a variable) and rejoin it in the proper order after doing some processing. Is there a way to use...
1
by: zeya_bakhtyar | last post by:
Here is the page architecture: Page loads multiple user controls (including nested user controls) dynamically based on parameters provided into place holders. Note: The page only has the logic to...
1
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are setup like 'number' 'category' 'code' 'shares' and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.