Results 1 to 5 of 5

Thread: [RESOLVED] [RESOLVED} Need VBA code to set field's enabled property to "false"

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    50

    Resolved [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

  2. #2
    New Member qwertypunk's Avatar
    Join Date
    Apr 2006
    Posts
    5

    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]

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    50

    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

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Need VBA code to set field's enabled property to "false"

    Access VBA question moved to Office Development

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    50

    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
  •  



Click Here to Expand Forum to Full Width