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

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

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 3183
missinglinq
3,532 Expert 2GB
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
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 Expert 2GB
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
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...
4
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...
1
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...
3
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...
1
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...
2
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...
0
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...
1
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...
8
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?...
4
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.