473,503 Members | 11,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to capture inserted value

Kev
Hello world,
I am trying to capture the latest entry into a text box by the user
and then insert it in a separate text box. I must not be searching the
right key words because I can only find oldvalue and value (which is
the old value plus the inserted or changed value) It is the inserted
or changed value that I want.
I have tried

Dim strControlName As String, strContValue As String, strContOldValue
As String
strContValue = CrntCtl.Value
strContOldValue = CrntCtl.OldValue
Me!Changes = (strContValue - strContOldValue)

but got data type mismatch.

So in summary; I am trying to achieve:

Textbox1 contains

"abc"

User adds

Carraige Return "def"

Textbox1 now contains
"abc
def"

How do I capture "def"

Any help gratefully appreciated
Regards
Kevin

Jun 28 '07 #1
2 2083
Hi,
You might try changing the property of the textbox, property=Enter Key
Behavior from Default to New Line in Field
bobh

On Jun 28, 2:44 am, Kev <Kev...@gmail.comwrote:
Hello world,
I am trying to capture the latest entry into a text box by the user
and then insert it in a separate text box. I must not be searching the
right key words because I can only find oldvalue and value (which is
the old value plus the inserted or changed value) It is the inserted
or changed value that I want.
I have tried

Dim strControlName As String, strContValue As String, strContOldValue
As String
strContValue = CrntCtl.Value
strContOldValue = CrntCtl.OldValue
Me!Changes = (strContValue - strContOldValue)

but got data type mismatch.

So in summary; I am trying to achieve:

Textbox1 contains

"abc"

User adds

Carraige Return "def"

Textbox1 now contains
"abc
def"

How do I capture "def"

Any help gratefully appreciated
Regards
Kevin

Jun 28 '07 #2
What you are doing sounds much like "multivalue fields", which are a
violation of relational design (but, despite which, Microsoft chose to
include in Access 2007 but tried to avoid controversy by calling it "complex
data"). If you'd explain what data you have and what you're trying to
accomplish, there's a good chance that someone would be able to suggest a
better solution than "multivalue fields" if that's really what it is.

I'm not sure what jahoobob provided... it seemed to consolidate the values
of two Controls, when I understood you wanted to split them.

Value provides the _current_ content of the Control.

If your "inserted value" will always begin with a carriage return, then you
can use the InStrRev (in recent versions of Access, or equivalent code in
earlier versions) to locate the carriage return, calculate the length, and
obtain the newly-added part by using the Right function.

However, unless you include VBA code to edit and validate, there's nothing
to keep a user from purposely or accidentally overtyping what's already
there, and the OldValue returns the value that was in the bound Field of the
RecordSource, when the Record was displayed. Or from adding a second
"insert", or ???

You could extract appended data by using the length of OldValue and Value,
for example:

Me.anotherCtl = Right(Me.origCtl, Len(Me.origCtl.Value) -
Len(Me.origCtl.OldValue))

but, let's just guess what would happen if the "insert" were actually
inserted... that is "def" were inserted between "a" and "b" of "abc" so that
OldValue = "abc" and Value = "adefbc".

Larry Linson
Microsoft Access MVP

"Kev" <Ke****@gmail.comwrote in message
news:11**********************@d30g2000prg.googlegr oups.com...
Hello world,
I am trying to capture the latest entry into a text box by the user
and then insert it in a separate text box. I must not be searching the
right key words because I can only find oldvalue and value (which is
the old value plus the inserted or changed value) It is the inserted
or changed value that I want.
I have tried

Dim strControlName As String, strContValue As String, strContOldValue
As String
strContValue = CrntCtl.Value
strContOldValue = CrntCtl.OldValue
Me!Changes = (strContValue - strContOldValue)

but got data type mismatch.

So in summary; I am trying to achieve:

Textbox1 contains

"abc"

User adds

Carraige Return "def"

Textbox1 now contains
"abc
def"

How do I capture "def"

Any help gratefully appreciated
Regards
Kevin

Jun 28 '07 #3

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

Similar topics

1
8728
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
1
1456
by: Michel | last post by:
When the mouse right-clicks a link in a inserted 3th party site (in a IFRAME or DIV) I like to capture the link and link-tekst in javascript. This way I would be able to lookup and show my price...
2
5961
by: Jose | last post by:
There's something for me to learn with this example, i'm sure :) Given this text: "....." and my first attempt at capture the groups: "(?:\)" RegExTest gives me what i expect: 6 captured...
3
1189
by: Juan | last post by:
I need to do some processing from my app after a row is inserted in an Orcale db, how can i do that? Thanks, Juan.
1
1586
by: Craig | last post by:
In ASP.NET 2.0 and the formview control how do you get the value of the identity field of a newly inserted record? In ASP.NET 1.1 after the new record was saved you just said intNewIdentityID =...
2
1362
by: eBob.com | last post by:
I am using regular expressions and a particular feature called "capture" (I think) to suck some information out of some html. I could have never come up with this myself but Balena has an example...
1
2276
by: linux70 | last post by:
Is it possible, using cx_Oracle to capture the simple messages from oracle, for example, if I am running an insert, in most Oracle tools, it would say '100 rows inserted'. I would like to capture and...
0
3466
by: j101 | last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but there seems to be a general problem loading a specify MQ shared library "/opt/mqm/lib/libmqm_r.so". I have MQ v6...
1
2708
by: =?Utf-8?B?QWxCcnVBbg==?= | last post by:
I have a regular expression for capturing all occurrences of words contained between {{ and }} in a file. My problem is I need to capture what is between those symbols. For instance, if I have...
0
7194
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
7070
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
7316
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...
1
6976
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
5566
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,...
1
4993
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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.