473,508 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Substring from Form Data

13 New Member
I'd like to take the First 8 characters of the data a user inputs into a form and populate another hidden field with it for saving to the table. I know how to hide the field but not how to get the substring from user input...any suggestions?
Jun 14 '07 #1
3 1780
FishVal
2,653 Recognized Expert Specialist
I'd like to take the First 8 characters of the data a user inputs into a form and populate another hidden field with it for saving to the table. I know how to hide the field but not how to get the substring from user input...any suggestions?
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Text4_AfterUpdate()
  3. Me.Text4 = Left(Me.Text4, 8)
  4. End Sub
  5.  
  6.  
Additional hidden field not needed.

Good luck.
Jun 15 '07 #2
ReubenPatterson
13 New Member
Thanks, but I'm looking to store both the submitted data and substring in a different field. Apologies if I wasn't very precise in the original post.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Text4_AfterUpdate()
  3. Me.Text4 = Left(Me.Text4, 8)
  4. End Sub
  5.  
  6.  
Additional hidden field not needed.

Good luck.
Jun 15 '07 #3
FishVal
2,653 Recognized Expert Specialist
Thanks, but I'm looking to store both the submitted data and substring in a different field. Apologies if I wasn't very precise in the original post.
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Text4_AfterUpdate()
  3. Me.Text5 = Left(Me.Text4, 8)
  4. End Sub
  5.  
  6.  
But it is not needed and moreover not reccomended to store derived data as you can easily retrieve it from the table with query.

SELECT Left(txtInput,8) AS txtLeft8Letters FROM tblTable;
Jun 15 '07 #4

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

Similar topics

1
8615
by: Tim Smith | last post by:
I am looking to extract form element values from html, more generally I have a substring that identifies the beginning of a value and a string that identifies the end of value and I need to extract...
7
2185
by: junky_fellow | last post by:
Can anyone suggest some efficient way to search a substring in a text file. For eg. suppose i want to search the pattern "abc" in a text file, then which algorithm should i use. I just want some...
2
6730
by: Michele Fondry via .NET 247 | last post by:
hello. I have a webform form app in vb.Net that uses a SQL query. I am trying to use the substring function, but get the following error: Description: An unhandled exception occurred during the...
2
2007
by: David Filion | last post by:
Hi, I have a question about substring(), when I run the following query: prepaid=# select substring('15148300', 0, 5); substring ----------- 1514 (1 row)
4
8750
by: Daviso | last post by:
Hi. I hava an input like this <td><input name=numberA> </td> and a button with a javascript function in onclick event. I want to control that the first element of the value I have...
29
51716
by: Ajay | last post by:
Hi all,Could anybody tell me the most efficient method to find a substr in a string.
8
2806
by: gmclee | last post by:
Hi there, I need a program to extract a substring from the following pattern xxxx<XXXXX>xxxx therer, x and X are any character and the string between < and is what I need. I use the following...
11
7010
by: dyc | last post by:
how do i make use of substring method in order to extract the specified data from a a long string? I also need to do some checking b4 extracting the data, for instance: it only will extract the...
3
2575
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Two part question: 1. Is Regex more efficient than manually comparing values using Substring? 2. I've never created a Regex expression. How would I use regex to do the equivalent of what I...
0
7228
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
7128
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
7332
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
7502
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
5635
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
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.