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.
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.
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?
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?
Isadogs,
Its that way because I want to have it displayed that way.
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.
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.
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
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.Code:Public Sub Form_Load() Me.NumHrs.SetFocus DoCmd.RunCommand acCmdAppMinimize End Sub
Maybe we are cross talking on "Focus"
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
I don't think there's any cross talk but maybe it's me...
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?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.
Micron,
After closing the report you CAN innput data. You cannot input dat without selecting the form on initial start up.
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