Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    Schererville, Indiana, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing/Adding Records (1997)

    I feel as if I have been using this quite a bit, but so far, everyone has been helpful, and it has so far kept me from having to have someone from outside the company design the database, and I am learning as I go.

    I have a problem that I am coming across and hoping that someone will be able to help me.

    It deals with the editing/add new information. I need to find a way to not allow editing of information already added, but allowing the users to edit the empty fields. The database is pretty empty right now. I only have 2 companies in it with very little information so there is a lot of blank fields. I was going to have the form allow additions but not edits, but then they will not be able to edit the companies that are currently in the database. Any suggestions?

    And just to be sure, setting the form to allow additions but no edits will prevent the users from being able to change what is currently in the records correct?

    Thanks again for your help!!

    Tracy

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Editing/Adding Records (1997)

    Hi Tracy,
    You may want to actually have two forms - one that lets users view data but not edit it, and another that is only for data entry. We often take that approach, especially if some fields in existing records can be edited, and other fields must not be. Forms have a property that is called data entry and if you set that to true, the only thing you can do is add records.

    HMM - in re-reading your post, I'm not confused (it happens pretty regularly <img src=/S/smile.gif border=0 alt=smile width=15 height=15>)
    <<I need to find a way to not allow editing of information already added, but allowing the users to edit the empty fields.>>
    and

    <<I was going to have the form allow additions but not edits, but then they will not be able to edit the companies that are currently in the database. >>
    seem contradicatory.

    Can you clarify exactly what it is you are trying to achieve <img src=/S/question.gif border=0 alt=question width=15 height=15>
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Editing/Adding Records (1997)

    If you set the Allow Additions property of the form to Yes and the Allow Edits property to No, the user will be able to add a new record, and modify the controls while staying in that record. As soon as the user moves to another record, the record just added will be locked, like all existing records, so the contents of *none* of the controls bound to the record source can be modified. As sson as the user adds a new record again, the controls will be unlocked.

    If you only want to lock those controls whose contents are not empty, you should set the Allow Edits property of the form to Yes. A bit of code in the On Current event of the form will take care of the locking/unlocking. See <post#=149439>post 149439</post#> - the code there is just for text boxes, but it could be expanded to take other controls into account (e.g. combo boxes).

  4. #4
    New Lounger
    Join Date
    Feb 2003
    Location
    Schererville, Indiana, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Editing/Adding Records (1997)

    Hans--

    You have been a big help!!

    One last question--in relation to the post you told me to visit, is it possible to apply it to the Memo fields as well? I have a few memo fields which need to be locked after they have information entered in them

    Thank you so much!! You have no idea how much I appreciate this!!

    Tracy

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Editing/Adding Records (1997)

    Maybe this example will help you.
    You'll need to find a way to reference it to your [ID] or [Company] """" or you can just pick bits out of it.
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Editing/Adding Records (1997)

    Memo fields are displayed in text boxes, just like text fields. The line<pre>If ctl.ControlType = acTextBox Then</pre>

    checks the control type, not the field type, so it should cover memo fields as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •