473,441 Members | 1,578 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,441 software developers and data experts.

Check the content for a bound textbox

759 512MB
Hello !
Can you help me, please !

I have a bound textbox (to a field in a table).
I wish to check if this textbox become empty while I type into.

I have tried:
Expand|Select|Wrap|Line Numbers
  1.     If txtValContor = "" Then...
  2.     If IsEmpty(txtValContor) Then...
  3.     If IsNull(txtValContor) Then...
  4.  
but with no success.

Seems that all this checks the value in the bound field, not what I see in my [Z{snip}] textbox.

Thank you !
May 31 '13 #1
4 2208
Mihail
759 512MB
Oups. Solved (after 2 hours. UFF).
If txtValContor.Text = "" Then...
May 31 '13 #2
zmbd
5,501 Expert Mod 4TB
Where exactly are you entering your code?
May 31 '13 #3
Mihail
759 512MB
OK with the profanity, zmbd, (but I have white hair after 2 hours for a "simple" task).

This is my code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtValContor_Change()
  2.     Dim Vis As Boolean
  3.     Vis = (txtValContor.Text <> "") And (Not IsNull(txtValRepartitor))
  4.     cmdOpenFormCitireRepartitoare.Visible = Vis
  5.     cmdOpenFormCitireCI.Visible = Vis
  6. End Sub
  7.  
  8. Private Sub txtValRepartitor_Change()
  9. Dim Vis As Boolean
  10.     Vis = (Not IsNull(txtValContor)) And (txtValRepartitor.Text <> "")
  11.     cmdOpenFormCitireRepartitoare.Visible = Vis
  12.     cmdOpenFormCitireCI.Visible = Vis
  13. End Sub
  14.  
I have to check two bound textboxes in order to show/hide two command buttons.

Every time I have needed to check the "other" textbox for NULL because the TextBox.Text works only if the control (the textbox) has the focus.

Hope that this is the answer you espect.
May 31 '13 #4
zmbd
5,501 Expert Mod 4TB
ahh.. it is the simple tasks that age us - hence children.
My work has a very strict profanity filter. In this case, your thread would have been blocked until I got home - worse, a copy of the page would have been sent to my IT security team who would more than likely decided that the entire site needed to be blocked as they error on the side of scorched-and-salted earth.

Yes, the dot-Text requires the control to have the focus; however, you can usually use the dot-Value - just depends on the information you need returned from the control.
May 31 '13 #5

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

Similar topics

2
by: WhiskyRomeo | last post by:
I have a bound textbox (bindings are set at design time) to a dataset column. Sometimes the value of this textbox must be set so that the underlying database field gets updated to null when using...
5
by: John Sheppard | last post by:
Hi there Does anyone know how to fill a bound textbox automaticlly. In an unbound textbox I would put in the control source =Sum(price, tax) (or some such function) and access updates it...
2
by: sandman | last post by:
When you put a bound TextBox on a tab control, the underlying Text property does't get loaded until the tab age is clicked and the text box is visible. Why is that? Is there a way around it? How...
1
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. ...
7
by: Howard Minor | last post by:
Not sure why this is an issue, but apparently when you paste a string into a textbox that is bound to a dataset/datasource, it does not save into the dataset. I've tried several things including...
0
by: j.t.w | last post by:
Hi, I'm trying to set a default date (today's date) to a bound textbox in an InsertItemTemplate of a FormView control. Currently, the RegDateTextBox value does get inserted when I insert the...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
19
Frinavale
by: Frinavale | last post by:
Filtering user input is extremely important for web programming. If input is left unfiltered users can input malicious code that can cripple your website. This article will explain how to make...
4
nev
by: nev | last post by:
i have a bound textbox. i am in record 2 and textbox displays 'hello'. now i added code to automatically save a new word entered in textbox. for example, while in record 2 which textbox displays...
7
by: billa856 | last post by:
Hi, My project is in MS Access 2002. In that I have two forms which I am using for Shipping Entry. Now First Form(ShippingAlerts) Is fillup by persons working in customer services.and the Second...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.