Edit only selected record on a subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shashirk
    New Member
    • Feb 2011
    • 2

    Edit only selected record on a subform

    I have a Maniform with a sub form attached to it, when ever people enter the data and save, all the records in the sub form with turn to "Allowedits = False" – This is the code that has been given on Button_Click.

    But I need the re-enable edit only selected records on the sub form

    Example: If I have 10 records in a sub form, and want to re-enable only the selected records (say 1 and 2 are selected records), how to do that with Access VBA

    Please help

    Thanks in advance
  • malcolmk
    New Member
    • Sep 2010
    • 79

    #2
    Presumably you can cycle through the records on the subform? Why not place the record numbers to edit in an array then in the subform oncurrent event (tells you which record is displayed) use code to enable editing or not depending on if the current record matches a record number in your array.

    Comment

    • Shashirk
      New Member
      • Feb 2011
      • 2

      #3
      malcolmk,

      Thanks for the reply,

      Can you please give me a code as an example, with the below details

      Main Form Name - frm_details
      Subform Name - sub_frm_details

      Thanks in advance

      Comment

      • malcolmk
        New Member
        • Sep 2010
        • 79

        #4
        How are you selecting the records to allow edit on? If you persue my idea above then you need to have some method of putting the record id into an array. Are you planning to select records from a dropdown box? If i work on some code then I must know from where on the main form I get the record id for edit? or maybe the records to allow edit are defined elsewhere?

        Comment

        Working...