Results 1 to 11 of 11
  1. #1
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9

    Angry why dosen't this work with sub form

    http://www.pcreview.co.uk/threads/se...-combo-box-usi

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That link goes to an error page.
    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
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9
    Sorry Try This, example works on main form but not on subform. http://www.pcreview.co.uk/threads/se...ng-vb.2070812/

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Well, it should.

    Need something to analyze. Post code or provide db.
    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.

  5. #5
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9
    Quote Originally Posted by June7 View Post
    Well, it should.

    Need something to analyze. Post code or provide db.
    Hi,
    Below is code for transparent command button.

    Private Sub Command27_Click()
    Me.Combo_thisweek_code.SetFocus
    End Sub

    Code for Combo.

    Private Sub Combo_thisweek_code_GotFocus()
    With Me.Combo_thisweek_code
    .SelStart = 0
    .SelLength = Len(.Text)
    End With
    End Sub


    Code works on mainform (with correct combo names)but not on subform

    Redkyte.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I have never used Text property. I use Value.

    What do you mean by 'transparent' button?

    If the combo is empty (Null) the code will error.

    Len(Nz(.Value,""))

    What do you mean by doesn't work, what happens - error message, wrong results, nothing?
    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.

  7. #7
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9
    Nothing happens, button is used as per code in link http://www.pcreview.co.uk/threads/se...ng-vb.2070812/ in my first thread.
    Using text or value doesn't seem to make any difference.

    Works great on mainform.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I can't replicate the issue (works in my db). If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  9. #9
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9
    Click image for larger version. 

Name:	addnstops form.png 
Views:	10 
Size:	42.5 KB 
ID:	22151
    Hi, Got to go work so no time for db upload tonight, Image is form i am using.
    Mainform combo is unbound, subform combo source is [code] field.

    Hope this helps.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Wait - Button is on main form but you want code to set focus on control in subform?

    Set the Code control to be the first in TabOrder.

    Then just set focus to the subform container.
    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.

  11. #11
    redkyte is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    9
    Sorted it!
    Used, On mouse up event

    Private Sub Combo_thisweek_code_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    With Me.Combo_thisweek_code
    .SelStart = 0
    .SelLength = Len(.Text)
    End With
    End Sub

    Works perfect.

    Many thanks for your help
    Redkyte

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

Similar Threads

  1. Replies: 3
    Last Post: 07-18-2015, 09:47 PM
  2. Replies: 8
    Last Post: 07-03-2015, 05:03 PM
  3. Replies: 4
    Last Post: 12-06-2014, 08:49 PM
  4. Replies: 6
    Last Post: 09-02-2012, 04:30 PM
  5. my search form won't work?
    By sams in forum Forms
    Replies: 5
    Last Post: 05-06-2010, 02:08 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