Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Isladogs,
    Understand it may be pointless, but I don't want the user to see the application. It does keep focus, most likely with Access being the focus itself. I prefer to keep it in a popup.

  2. #17
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    Even when I minimize the app, I can still direct focus to any textbox on my test popup form.
    I just got back thus haven't had a chance to download the first file. Should I take a look or is this OK now?

  3. #18
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by Thompyt View Post
    Isladogs,
    Understand it may be pointless, but I don't want the user to see the application. It does keep focus, most likely with Access being the focus itself. I prefer to keep it in a popup.
    The user will see the application as soon as they click on the taskbar icon.
    What's the logic in having a report open but minimised to the taskbar?
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #19
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Isadogs,
    Its that way because I want to have it displayed that way.

  5. #20
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Fine. Its your app. But in that case you have to put up with its behaviour when the form is activated
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  6. #21
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    I did download and after inserting a code line to set focus I can do so for either control. The sample db code made no attempt to do that so I found that to be a bit confusing.

  7. #22
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Micron,
    What code did you use to set focus?

    Note: The cursor does show it being in the NumWatts field, but you can see the title is greyed out, thus not focused. If you try to type in without selecting the form, it doesn't work.

    Form Name is [Input]
    Form Control for focus is [NumWatts]

    Forms!Input!NumWatts.SetFocus
    Me.NumWatts.SetFocus

    I tried these on Form_Load(), Form_Current(), Form_Activate(). It also seems that Access is not focused if I open it and hit Alt F11. You have to click on Access first, then Alt F11.





  8. #23
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    the db you posted has no code for this, so I'm afraid I find your assertion that you tried this or that event somewhat confusing. Perhaps you simply left it out of your copy? Or did you create these events and not put any code in them to do what you want? That's the part I don't get. To be sure, I just opened the db, the form opened and app minimized, the cursor is flashing in hours field. As soon as I started typing, characters were entered. When the report opens, I close it and the input form comes back into view. I type and immediately the characters show in the hours field. The code is
    Code:
    Public Sub Form_Load()
    Me.NumHrs.SetFocus
    DoCmd.RunCommand acCmdAppMinimize
    End Sub
    Now I did make a few changes because having the app close on you while trying to test is a PITA. I don't think anything that I did (other than add the code line) would make any difference.

  9. #24
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Maybe we are cross talking on "Focus"

    Click image for larger version. 

Name:	NotFocus.PNG 
Views:	10 
Size:	28.4 KB 
ID:	40308


    The cursor is in the NumWatts control. Note that the Focus is not on the form as indicated by the greyed out title bar text circled in red. IOT input data in the NumWatts control you must click on the form, otherwise you can type to your hearts content and no data will be input. Below is the code I tried to get the focus on the form.

    Code:
    Option Compare Database
    Public Sub Form_Activate()
        Forms!Input!NumWatts.SetFocus
        Me.NumWatts.SetFocus
    End Sub
    Public Sub Form_Current()
        Forms!Input!NumWatts.SetFocus
        Me.NumWatts.SetFocus
    End Sub
    Public Sub Form_Load()
        Forms!Input!NumWatts.SetFocus
        Me.NumWatts.SetFocus
        DoCmd.RunCommand acCmdAppMinimize
    End Sub
    Private Sub NumHrs_AfterUpdate()
    On Error GoTo OpenRpt_Click_Err
        DoCmd.OpenReport "rptBatteryInfo", acViewReport
            DoCmd.Restore
        DoCmd.Close acForm, Me.Name
    OpenRpt_Click_Exit:
        Exit Sub
    OpenRpt_Click_Err:
        MsgBox Error$
        Resume OpenRpt_Click_Exit
    End Sub
    Private Sub Max_Click()
    DoCmd.RunCommand acCmdAppMaximize
    DoCmd.Close acForm, Me.Name
    End Sub

  10. #25
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    I don't think there's any cross talk but maybe it's me...
    IOT input data in the NumWatts control you must click on the form, otherwise you can type to your hearts content and no data will be input.
    But I expressly said that I type and data gets entered into the control - and this happened when the report closed. Maybe remove the form focus setting line because as you should be able to determine, I didn't use it. Did you try what I posted?

  11. #26
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Micron,
    After closing the report you CAN innput data. You cannot input dat without selecting the form on initial start up.

  12. #27
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    FWIW in my tests on your v2 which minimises to the taskbar each time, the form always shows an active title bar though I have to click on it to type.
    I'm also completely baffled by the purpose of your report which always shows the same unfiltered data together with the two numbers from the form.

    Anyway, I'll drop back out again now as having to click the taskbar icon each time is extremely annoying and will I think get a lot of complaints from end users
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  13. #28
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    Quote Originally Posted by Thompyt View Post
    Micron,
    After closing the report you CAN innput data. You cannot input dat without selecting the form on initial start up.
    That may be your experience but it's not mine. Sorry but as I can't seem to get that point across I'll have to bow out. Good luck with it.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Set focus to another form
    By aytee111 in forum Programming
    Replies: 19
    Last Post: 11-01-2015, 01:40 PM
  2. Replies: 5
    Last Post: 01-24-2015, 12:59 AM
  3. Set focus in sub form
    By Derrick T. Davidson in forum Forms
    Replies: 7
    Last Post: 08-15-2014, 08:18 AM
  4. Opening a report and setting focus to it
    By Kirtap in forum Programming
    Replies: 2
    Last Post: 02-19-2014, 12:05 PM
  5. Replies: 1
    Last Post: 02-29-2012, 09:38 AM

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