Results 1 to 3 of 3
  1. #1
    jaymin is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jan 2012
    Location
    gold coast Australia
    Posts
    57

    trouble with focus going from a subform combo to a main form button

    Hope someone can put me staright, i have a form with a subform that i enter data with, on the last combo box i have a subroutine that should take me to a button on the main form i am using this
    Code:
    Me.Parent!cmbClose.SetFocus
    as the code in the "afterupdate" event. I keep getting an error message "can't move the focus to the control cmbClose"
    I have used the format from the link below.
    http://access.mvps.org/access/forms/frm0031.htm or if there is another way to achieve the same outcome.

    Also i get this error message "search key was not found in any record"
    Code:
    Me!sbfNew_PPE.Form!cboFitting.Enabled = False
    I have tryed to check on the forum for clues and it seems the problem occures with spaces when importing any files.



    Peter

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I have never used the Parent qualifier. I reference forms explicitely.

    Forms!mainformname.cmbClose.SetFocus
    or in VBA can also use
    Form_mainformname.cmbClose.SetFocus

    Is sbfNew_PPE the name of the subform or the container control that holds the form object? I always give container control a name different from the object (table, query, form, report) it holds, like ctrPPE.
    Me.ctrPPE.Form.cboFitting.Enabled = False

    I use dot (.) instead of bang (!) when referencing controls because it provokes intellisense popup tips.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jaymin is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jan 2012
    Location
    gold coast Australia
    Posts
    57
    June7
    Thank you for your help
    Peter

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

Similar Threads

  1. Replies: 1
    Last Post: 02-29-2012, 09:38 AM
  2. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  3. Call a button on the main form from the subform
    By Grooz13 in forum Programming
    Replies: 1
    Last Post: 09-28-2011, 01:15 PM
  4. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  5. Replies: 0
    Last Post: 07-26-2010, 04:36 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