subform edit issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Angel Guzman
    New Member
    • Nov 2010
    • 1

    subform edit issue

    I am new to a VBA and only a little exposure to Access 2010. I’ve been battling a problem for a few days. I have a mainform with 2 subforms. Data in subform 2 is filtered to the record selected in subform1. I have no problems with data between the mainform and subform1. The frontend is in MS Access 2003 and the backend is a SQL server database.

    The particular problem I am having is when I click in subform2 to add/edit data, the last record I touched in subform1 also goes into edit mode. I’ve tried googleing this various ways but it is difficult to describe in a search.

    I’ve tried setting access properties between subform1 and subform2 for GotFocus/Lost Focus, On Load/UnLoad, update/insert. Added VBA code setting: setfocus, doevents, and requery, in various places, but nothing seem to work. No matter what I add/change subform1 or subform2 , it goes back to edit mode in both subforms.

    I have no one at work who can assist. I really need someone to point me in the right direction.
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi Angel. I suspect that when you say the record in subform 1 goes into edit mode you mean that when you edit data in subform 2 the data in subform 1 also changes. If this is so it suggests that you have a problem with your choice of recordsource for the two subforms - that you may be editing a field on the 'wrong' side of a 1 to many relationship, for instance, or that you are modifying a field from the same row of a table as one that is displayed in the first subform.

    Could you be more specific about what is happening? We'd like to help if we can, but I'm just guessing here about what you mean when you say that subform 1 'goes into edit mode' when you are in subform 2. Clearly you can only edit one record at a time.

    -Stewart

    Comment

    Working...