|
-
Apr 23rd, 2006, 10:38 PM
#1
Thread Starter
Member
[RESOLVED] [RESOLVED} Need VBA code to set field's enabled property to "false"
I need vba code that will set the enabled property of a field named "Remarks" to "false" if data is present and leave it "true" if it has no data. This is an Access 2000 database (Flat file).
Thanks
Carbo
Solution:
Private Sub Form_Current()
If IsNull(Remarks) Then
Remarks.Enabled = True
Else
Remarks.Enabled = False
End If
End Sub
Last edited by carbo; Apr 24th, 2006 at 05:22 PM.
Reason: Resolved
-
Apr 23rd, 2006, 10:41 PM
#2
New Member
Re: Need VBA code to set field's enabled property to "false"
can u be a more explicit ......more precise please
There are two ways of makung error free programs ...only the third one works.
TIP- If u find a post useful click on the Add to reputation or rate this post.
[IMG]Thank You[/IMG]
-
Apr 23rd, 2006, 10:59 PM
#3
Thread Starter
Member
Re: Need VBA code to set field's enabled property to "false"
This particular database, because of the nature of it mission, is designed to allow users to scroll back to previous records and make additional entries, Not all records however have data in the remarks field and current conditions require the records with data in the remarks field to be enabled=false to avoid corruption problems that sometime occur in memo type fields in a multi user environment in msaccess. So I have programmed a button with a code “Remarks. Enabled=True” that the user uses if the field need to be edited. I have tried the following code but it ignores records with data.
Private Sub Form_Current()
If Remarks.Value = Not Null Then
Remarks.Enabled = False
End If
End Sub
-
Apr 24th, 2006, 06:24 AM
#4
Re: Need VBA code to set field's enabled property to "false"
Access VBA question moved to Office Development
-
Apr 24th, 2006, 05:12 PM
#5
Thread Starter
Member
Re: [RESOLVED] Need VBA code to set field's enabled property to "false"
Private Sub Form_Current()
If IsNull(Remarks) Then
Remarks.Enabled = True
Else
Remarks.Enabled = False
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|