473,626 Members | 3,459 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 3819
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(strPubV ar) = 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.goo glegroups.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
2800
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 one hand, the warning *could* be useful. Most of the time I get it in cases where I know the comparison is safe, but it's not hard to imagine that this won't always be the case. This makes disabling it undesirable. Casting is a workable solution,...
5
2288
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 DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles DataGrid1.ItemCommand
1
5092
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 put a value 'abc' set in the value attribute <inptu type=text value="<%= var1%>"> .now I want to change the value in the textbox and add it to database. hoe should I do it.
5
13500
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 my requirement.. thanks in advance for ur valuable reply let me know the best to do it urs
6
3140
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 changed by user as well. now, when you press the button the date should be inserted into a database. the problem is that , yes it has been inserted, but it is always the current date. even if a user modified the date, it would be inserted the current...
1
1881
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 System.EventArgs) Handles Me.Unload txtPopConfirm.Text = intCountAnswer1 End Sub
1
2316
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
10134
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
5101
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
8202
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.