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

I typed in a text field of a new record, and now I can't delete it...

Hi. I have a form with three fields:
OWNER - Default is user login
DATE_TIME - Default is Now()
Neither of the above can the user change.

The last field is a long text / memo field, WORK_NOTES, that the user can update.

Unfortunately, sometimes they will go to type something in and then change their mind. When they delete everything in the field, the form still tries to save something, I'm assuming because once I type something in this field the other two fields become.... active? I don't know.

I have tried the following with no success:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. If Len(Me.WORK_NOTES.Text) = 0 Then
  3.   Me.Undo
  4.   Canel = True
  5. End If
  6. End Sub
This did nothing for me at all. Only by clicking the undo arrow can I first see what I had typed, and then clicking it again shows a blank form I can escape from.
Aug 25 '17 #1

✓ answered by NeoPa

You have a typo in your code at line #4. From which I assume you need to see Require Variable Declaration.

3 1910
NeoPa
32,556 Expert Mod 16PB
You have a typo in your code at line #4. From which I assume you need to see Require Variable Declaration.
Aug 25 '17 #2
Thanks NeoPa. I'm under the assumption that "Cancel as Integer" in line 1 is the variable declaration. Is that incorrect?
Aug 28 '17 #3
NeoPa
32,556 Expert Mod 16PB
Yes. That's correct. Setting Cancel to True is also perfectly valid, but setting Canel certainly isn't.

If you followed the link you'll have seen recommendations that would set up your project such that similar typos would be caught a long time before you could post such a question. It will save you from loads of such issues if you let it. I can hardly overstress the importance of this one point.

Good luck.
Aug 28 '17 #4

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

Similar topics

1
by: Barry | last post by:
Retoring Caret Position after text field correction -------------------------------------------------------------------------------- Hi, my code has the following form - function...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
1
by: David | last post by:
Hi, I have a continuous form. For each record I have a field 'HeldDate' (Text Field from a table) Against each record I have a button which sets the visibility of this text box to 'True' and...
1
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like...
3
by: pollygw | last post by:
I have a page that dynamically adds rows to a table and the user can also delete any of the rows in no specific order. When the form is submitted I need to do some validation. I can't loop through...
2
by: Sheldon | last post by:
If I type lower case "i" in a one byte text field, it automatically converts to an upper case "I". If I type in any other lower case letter it syays in the field as I typed it. If I make the...
7
by: kirkgilbert | last post by:
I am trying to do an onchange event in a form using a text field. The form is tied to a record set that is part of a repeated region. One the first record when I edit the data it works perfectly. ...
1
by: evildracko | last post by:
first a write error prompt Title: Write Conflict Text: This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other...
2
by: MOCaseA | last post by:
OK I have a problem. I'm fairly sure this has been answered somewhere, but ai can't seem to find it. I have a single table with 3 fields: Table1: empFirstName empLastName empFullName In a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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...
0
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
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...

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.