473,499 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing Original Value to New Value in the same textbox.

I have a bound textbox called txtMyBox with the current string value
of "200".
Once the user enters the textbox, and while the user is still in the
textbox, I would like to check the changed value using a function to
see if this changed value exists in a table. If it does, I want do
give a Msgbox Warning and restore the original value.

I thought that I would require the OnUpdate property of the textbox to
do this, but I can't seem t
to compare the original value to a newly entered value. Am I in the
wrong property???

Thanks Greg

Jan 28 '07 #1
5 3810
Sorry

Meant to say BeforeUpdate property!
>thought that I would require the OnUpdate property of the textbox
to
>do this, but I can't seem t
to compare the original value to a newly entered value. Am I in the
wrong property???
Greg
Jan 28 '07 #2
My Solution required the AfterUpdate Event

Had to assigned value to a Public Variable outside the AfterUpdate
event
strPubVar = Nz(Me.txtMyBox, "")

Then in the AfterUpdate Event of txtMyBox placed my duplicate
function:
If Duplicate Then
Me.txtMyBox = IIf(Len(strPubVar) = 0, Null, strPubVar)
End If
Jan 28 '07 #3
Ap******@gmail.com wrote:
I have a bound textbox called txtMyBox with the current string value
of "200".
Once the user enters the textbox, and while the user is still in the
textbox, I would like to check the changed value using a function to
see if this changed value exists in a table. If it does, I want do
give a Msgbox Warning and restore the original value.

I thought that I would require the OnUpdate property of the textbox to
do this, but I can't seem t
to compare the original value to a newly entered value. Am I in the
wrong property???
I believe the .OldValue property of the textbox will hold the original value and the
..Value property will hold the updated value. The .Text property may also be of interest.

..BeforeUpdate would seem to be the event to use. Haven't tested this but should be easy
enough for you to experiment with.

--
'---------------
'John Mishefske
'---------------
Jan 29 '07 #4
John

I am using Access2K, and do not see the .OldValue property of the
textbox.
This must have been a latter improvement?

Thanks Greg

Jan 30 '07 #5
<Ap******@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
John

I am using Access2K, and do not see the .OldValue property of the
textbox.
This must have been a latter improvement?
There is no property box for it as it is only available in code. All versions
have it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 30 '07 #6

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

Similar topics

16
2785
by: Kevin Goodsell | last post by:
What do you think is the best way to handle a compiler warning about comparing an unsigned value to a signed value? Cast to silence it? Disable that warning altogether? Or just live with it? On...
5
2272
by: velu | last post by:
Problem in getting value from textbox & radiobuttonlist to a valuable inside a datagid. I want to insert a record into a table thru datagrid. Here is the code (see below) Private Sub...
1
5086
by: rudranee | last post by:
Hi everyone, I want to know how can i edit a value in textbox in html . I have a field where I have already put a value from database but i also want to edit it . for example ,if in a textbox i...
5
13471
by: SKS | last post by:
hi all i would like to know how to restrict user from entering numeric value ina textbox..using C# if user try to enter text it shouldnt be allowed.. i tried errror provider.. but it doesnt met...
6
3134
by: Chris | last post by:
I created a very simple web page in asp.net. there are only a textbox and a button on the page. when the page loads into web browser there is current date in the textbox. but the date can be...
1
1874
by: abirami elango | last post by:
Hi, i have created a web application in vb.net. i have assigned a value to the textbox during page UNLOAD event as below.. ......... Protected Sub Page_Unload(ByVal sender As Object, ByVal e As...
1
2303
by: adepvivek | last post by:
Hi everybody, I am using textbox in gridview as template. And I want to stored the value of textbox. For that I want to pass the textbox value to stored procedure. So please give me solution.
5
10128
oranoos3000
by: oranoos3000 | last post by:
hi I want to send value of textbox without using form tag and submit button to another page? Is it possible with php ? How do I get this thing work? thanks alot
2
5084
by: s k parimal | last post by:
How to validate decimal value in textbox using C#? I am using this (^(*|\d*\d{1}?\d*)$) but it not working help
0
7006
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
7169
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,...
1
6892
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...
1
4917
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
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
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
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
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.