Results 1 to 5 of 5
  1. #1
    mike_980 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    58

    Problem with subform automatically jumping to previous record

    I have a form with a subform and to put it simply, the main form contains a box with a numerical field where the user inputs for example "384". However, if the value is the same as a previous record, the subform automatically jumps to the previous record so when the user changes the subform fields to the values of the new record, the old record is replaced. Is there some setting somewhere to ensure that the subform doesn't fill itself with the previous record?

  2. #2
    mike_980 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    58
    I have half fixed this issue by replacing the parent-child relationship with my own code which links the two fields. It works perfectly so long as I fill out the subform first then go back to fill in the "parent" value. My problem is that if I fill out the "parent" control first then move onto the subform, the subform doesn't work. The list of values in the comboboxes appear fine but it doesn't let me select anything as if the subform is disabled somehow. All the settings in properties look in order so I suspect it may be a setfocus issue, anyone have any ideas?

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You have something backwards by the sound of it.
    Form /subform set up typically involves 2 underlying tables that are related 1 to Many.
    The MainForm is the 1 side and the subform is the Many side.
    A record MUST exist in the Main Form (1 {Parent} table) before you can add a record on the Many/{Child} form.

  4. #4
    mike_980 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    58
    Mine is working a little differently, I basically have a form which enables you to do one of two things and the job is selectable using a toggle button (I.e add to store or remove from store) however if the user is removing from the store, it needs to be logged where the stock is going. To make it cleaner I used a subform for this job which appeared only when necessary rather than bringing up another form so there is no relationship between the two tables being updated.

    I managed to get it working just now, I was right it was a setfocus issue, all I had to do was set the focus to the subform before I sent the value to the subform control from my main form. Without the set focus, the command would still work just fine but it locked up the whole subform as soon as the focus was taken away from it. Strange issue but it's sorted now at least

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Glad you have it resolved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 03-20-2014, 09:31 AM
  2. Replies: 5
    Last Post: 07-19-2013, 03:42 PM
  3. Replies: 12
    Last Post: 12-06-2012, 05:36 PM
  4. Replies: 1
    Last Post: 04-09-2012, 02:14 PM
  5. Automatically show previous dates.
    By mbonning in forum Access
    Replies: 6
    Last Post: 09-12-2011, 12:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums