473,885 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Turning AllowEdits to false for individual fields within a form/sub-form

8 New Member
Hi Guys

I was wondering if it is possible to turn AllowEdits to false after data has been entered for individual fields within a form/sub-form. I've found that I can do this in the 'AfterUpDate' by assigning Me.AllowEdits = False .... BUT this then doesn't allow me to update data in other fields within that form/sub-form after it has been saved ... it seems to assign this property all the other fields within the form/sub-form ...

Any assistance would be greatly appreciated.

Cheers
Kate
Jul 1 '09 #1
3 3209
missinglinq
3,532 Recognized Expert Specialist
You can Lock the individual fields. IF you only want to lock the field after the record is saved, use

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If IsNull(Me.YourTargetField) Then
  3.   YourTargetField.Locked = False
  4.  Else
  5.   YourTargetField.Locked = True
  6.  End If
  7. End Sub
  8.  
If you want to lock the field as soon as data is entered and the user tabs out of the field, use the above code and add this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourTargetField_AfterUpdate()
  2. If IsNull(Me.YourTargetField) Then
  3.   YourTargetField.Locked = False
  4.  Else
  5.   YourTargetField.Locked = True
  6.  End If
  7. End Sub
I have to warn you, as I do with everyone doing this kind of thing, you need to have some strategy in place for editing the field if it becomes necessary, as it almost always does!

Linq ;0)>
Jul 2 '09 #2
kate2272
8 New Member
Hi Linq,
Thanks heaps for your help. The fields in question are defaulted to automatically display date and time of commencement of the record ... therefore, it is important that these fields aren't altered after the record has been saved, so the record can be accurately monitored for efficiency for completion.
Thank you once again.
Kind regards
Kate
Jul 5 '09 #3
missinglinq
3,532 Recognized Expert Specialist
Glad we could help, Kate!

Linq ;0)>
Jul 5 '09 #4

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

Similar topics

3
1398
by: CSDunn | last post by:
Hello, I have a situation in which each record on a report has 40 fields, any one of which can contain a value of 'C', or 'I', or 'B'. I need to create one calculated field on the report that will COUNT the number of fields with a value of 'C'(and shows the integer result), and another calculation that will take the COUNT of the fields with a value of 'C' and divide that by the total number of fields. The second calculation would be...
4
6043
by: Martin Lacoste | last post by:
(Access 2000) Two issues: Within a query, I need to return a field name as data (see eg. below). I need to search within 80 fields (same criteria) - is there a way to avoid 80 separate expressions (the 80 field names are stored in a table - can I get the query to look each of these up?)? Here's an example:
1
4967
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word 1. Query..I want to keep the fields seperatred. I do not want to sent on field with all accumulated languages from one person to Word. Each language should appear in the document in a separate cell Cross tables are not delivering the result I...
3
7511
by: Gerry Abbott | last post by:
Hi all, Im wondering why the following will work Me.Controls("subnonstorePos").visible = False while Me.Controls("subnonstorePos").AllowEdits = False give me an 'property not support by this object error'
1
2012
by: psuedonym | last post by:
Can someone please explain to me how the complier can manage to make sense out of the following bit of nonsense ;-) My Solution Name: Dim.sln My Project Name: Dim.vbproj (Standard Console Application) My File Name: Dim.vb (Standard class module) Namespace ' Class to manipulate brightness in VB
2
947
by: Kent Ogletree | last post by:
I have built a user control that actually has 3 different sub user controls embedded in it. Each of these sub controls displays data differently depending on what a user selects and are tightly related to the others. The problem I am running into is that even when I set visible to false, or even disable the sub controls since they are not currently needed they still execute and pull data from the database. This is going to make a major...
0
1376
by: KarenS | last post by:
I am using Microsoft Developer Environment 2003 Version 7.1.3088 and .NET Framework version 1.1.4322 SP1. From my web-service I get one row of data and return it to my client. From my client I want to be able to parse apart the Data in the returned XML string by field name. (<group_name>, <city>, <state?, etc.) Thank-you. More details follow: (The Data set is sent to the client from the web-service with .GetXML, see
1
1363
by: Holly55 | last post by:
I have created a database and wish to lock individual fields so that once information has been entered, it cannot be changed. I have done this through an event procedure... Private Sub Form_Current() Me.sample.Enabled = Me.NewRecord End Sub Private Sub sample_BeforeUpdate(Cancel As Integer)
8
11761
by: Jeff Ciaccio | last post by:
I would like to create a toggle button, so I chose a radio and set its apperance to button. Is seems my method always makes this .checked = false. Can somebody help me to see the error in my ways? I'm guessing that I just need an event that triggers before it actually changes the value of the button. Private Sub radSound_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radSound.Click If radSound.Checked = True...
4
7838
by: thecheyenne | last post by:
Hi there everybody; Fresh from reading my Access VBA for Dummies, I'd like to update my database about activities on a school outing. Here's what I'd like to achieve. The school outing costs money - nothing's for free these days. The prices for the individual activities are stored in tbl.prices; in this table, there are 3 fields: PriceID, Amount, Description and 4 records: a record for the morning activity a...
0
9956
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11172
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
10770
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
10871
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
10427
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...
0
7139
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
6010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4235
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.