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

howto clear value of unbound textbox on Ms Access form and return focus

3
I have a form with an unbound textbox and after receiving a value, some checks should be done and maybe even some records inserted in the subform. All of that is going well, but the problem is that whatever happens, the textbox should regain focus and should be clearde. I can do either one or the other, but I can't seem to get both tasks done at the same time.

Returning the focus: I can manage via the beforeupdate event
Clearing the value: I can only do using the afterupdate event, which is skipped when some requirements aren't met.

Does anybody have a clever idea? :)

Thanks up front!

Germaine
Jun 2 '10 #1
3 4089
vb5prgrmr
305 Expert 100+
Okay, if the before update event set the focus to the textbox no matter what, then could not the next line be .text = vbnullstring? Or in the after update event? Maybe in the got focus event of the textbox? Don't know as I don't do much VBA...



Good Luck
Jun 2 '10 #2
Ghaime
3
thx 4 your reply, but in the beforeupdate you can't put the value to null.
Like I said before: if requirements aren't met, the afterupdate isn't called. So the afterupdate doesn't work either. The Gotfocus isn't fired at all after leaving dialog boxes opened by the function Msgbox. So that doesn't work either.
Jun 3 '10 #3
vb5prgrmr
305 Expert 100+
Well sorry I couldn't help as I don't do much VBA and use those events even less in VB6.0...



Good Luck
Jun 3 '10 #4

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

Similar topics

4
by: Roger Withnell | last post by:
I want to validate the data entered into a form text field by calling a function with onblur, doing the validation and, if the input is invalid, giving an alert to the user and returning focus and...
2
by: Paul .V. | last post by:
I have a report which I call to print from a form. For security reasons I have created a global variable: Const Company = "This Test Company" I call that constant whereever I want the company...
0
by: jaYPee | last post by:
I have an unbound textbox in my report that is bound from the textbox in my Dialog Form using a controlsource using Access 97. However after I ported my database to SQL Server 2000 and use Access...
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...
3
by: Richard | last post by:
How is the result of query placed in a unbound textbox ? Suppose CriteriaLookups has columns TableName, KeyColumn, KeyValue, DataColumn Foo,x,11,xhat Bar,z,3,xyzzy And
5
by: Bob Sanderson | last post by:
I need a JavaScript that will allow me to clear a field in a form when I click an image next to it. Any help will be greatly appreciated.
1
by: dpark29 | last post by:
Access 2000 - If a textbox control is bound to a hyperlink field in an Access database table, the textbox appears formatted as hyperlink and when the user right-clicks the field, the Hyperlink option...
3
by: chetu | last post by:
I am getting the above msg. when I click my form, it was running fine yesterday, but not sure what happened. Can any one help?
2
by: Lewe22 | last post by:
I am creating a small Access db which performs a series of updates to a SQL db. The Access db consists of a ‘Main Form’, from which the user can run each update via a series of command buttons. ...
12
by: pugalenthi | last post by:
For example, i have a text box with value 1.64999997615814. How can i round it off to 1.7 ?. Is this possible using the text box control properties ?.
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...
0
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...

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.