Can't get my Focus

I have a form(frmProducts) on a tab control object (TabClt) that is on 
another form(frmOrders).
I have a search box on frmProducts that filters "On change" and then keeps 
its focus in that box.

Private Sub txtDescSearch_Change()
    DoCmd.ShowAllRecords
    Me.Filter = "Description like '" & txtDescSearch & "*'"
    Me.FilterOn = True
    Me.txtDescSearch.SetFocus
    SendKeys "{F2}"
End Sub

It works fine when I open frmProducts by itself but when I open the tab it 
is on from frmOrders.
When I enter the first search letter it does filter but the focus goes to 
the tab label.
I tried changing
Me.txtDescSearch.SetFocus
To
Forms!frmProducts! txtDescSearch.SetFocus
But that did not seem to help either.

What am I doing wrong here?


Thanks in advance
D 

0
Dave
7/25/2007 4:08:27 AM
access 16762 articles. 3 followers. Follow

2 Replies
754 Views

Similar Articles

[PageSpeed] 4

Hi Dave

Set the focus to the subform (Tab) 1st, then (after) set the focus to the 
control

abcSubForm.Setfocus
xyzControl.Setfocus

Hope this helps

-- 
Wayne
Manchester, England.



"Dave" wrote:

> I have a form(frmProducts) on a tab control object (TabClt) that is on 
> another form(frmOrders).
> I have a search box on frmProducts that filters "On change" and then keeps 
> its focus in that box.
> 
> Private Sub txtDescSearch_Change()
>     DoCmd.ShowAllRecords
>     Me.Filter = "Description like '" & txtDescSearch & "*'"
>     Me.FilterOn = True
>     Me.txtDescSearch.SetFocus
>     SendKeys "{F2}"
> End Sub
> 
> It works fine when I open frmProducts by itself but when I open the tab it 
> is on from frmOrders.
> When I enter the first search letter it does filter but the focus goes to 
> the tab label.
> I tried changing
> Me.txtDescSearch.SetFocus
> To
> Forms!frmProducts! txtDescSearch.SetFocus
> But that did not seem to help either.
> 
> What am I doing wrong here?
> 
> 
> Thanks in advance
> D 
> 
0
Utf
7/25/2007 10:12:02 AM
Thanks Wayne,
I made several attempts at what you suggested with no luck

I keep getting an error trying any of these to get the focus back on the 
subforn first.

frmProducts.Forms!.SetFocus

Forms!.frmProducts.SetFocus

frmProducts.Form!txtCodeSearch.SetFocus

Any suggestions what I am doing wrong there?
D

"Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message 
news:24F82EDE-1FFC-4B42-B104-2152484C1FAF@microsoft.com...
> Hi Dave
>
> Set the focus to the subform (Tab) 1st, then (after) set the focus to the
> control
>
> abcSubForm.Setfocus
> xyzControl.Setfocus
>
> Hope this helps
>
> -- 
> Wayne
> Manchester, England.
>
>
>
> "Dave" wrote:
>
>> I have a form(frmProducts) on a tab control object (TabClt) that is on
>> another form(frmOrders).
>> I have a search box on frmProducts that filters "On change" and then 
>> keeps
>> its focus in that box.
>>
>> Private Sub txtDescSearch_Change()
>>     DoCmd.ShowAllRecords
>>     Me.Filter = "Description like '" & txtDescSearch & "*'"
>>     Me.FilterOn = True
>>     Me.txtDescSearch.SetFocus
>>     SendKeys "{F2}"
>> End Sub
>>
>> It works fine when I open frmProducts by itself but when I open the tab 
>> it
>> is on from frmOrders.
>> When I enter the first search letter it does filter but the focus goes to
>> the tab label.
>> I tried changing
>> Me.txtDescSearch.SetFocus
>> To
>> Forms!frmProducts! txtDescSearch.SetFocus
>> But that did not seem to help either.
>>
>> What am I doing wrong here?
>>
>>
>> Thanks in advance
>> D
>> 

0
Dave
7/25/2007 4:44:26 PM
Reply:

Similar Artilces:

Computer crashed, how do I get emails back?
My computer drive had to be reformated Sunday night with no option to get information off of it. What happened to all my emails? Are they downloaded to my computer and therefore gone? "Light Bringer" wrote in message news:FC5B71A5-04A8-438F-9BE8-45BCD966F33C@microsoft.com... > My computer drive had to be reformated Sunday night with no option > to get > information off of it. What happened to all my emails? Are they > downloaded > to my computer and therefore gone? Depends on the e-mail account type. If POP, yes. If IMAP, no. If you don't execute reg...

CEdit selection focus
I need to implement something like a find/replace dialog. So I select the text in the CEdit and then bring up a dialog to ask the user what to do with the selection. The problem is that the selection in the CEdit is only visible when the CEdit has the focus. Since the dialog steals the focus, the selection is not visible and the user does not know what (s)he is being asked about. How can I keep the focus on the CEdit (or keep the selection visible) while asking the user for input? On Jan 23, 11:53=A0am, Alexander <the44s...@yahoo.com> wrote: > I need to implement something like a f...

Getting rid of a BAD Exchange email account
OK! I messed up installing Outlook 2007 on my new laptop and put in Exchange, when I should have said IMAP; now, how do I delete the Exchange account? Outlook says I have to wait until it finishes copying my settings over to the new account; however, it cannot login into a non-existent Exchange Account. Un-Install does *NOT* delete any of the account data (Somewhat like a virus, that makes changes that cannot be undone) and I've tried deleting all of the directories undir the %appdata% paths. Any suggestions? -- \\ Mike Use the mail applet in the control panel to ...

I can't even get Outlook 2007 installed on VISTA
Hi everyone. I'm getting really frustrated. Since early December of last year I have been trying to install Outlook 2007 on my Vista machine. EVERY time I try, I receive an ERROR 1406. Error 1406. Setup cannot write the value to the registry key \SketchObj.SketchInk. Verify that you have sufficient permissions to access the registry or contact Microsoft Product Support Services (PSS) for assistance. For information about how to contact PSS see C:\Users\Edward~1\AppData\Local\Temp\Setup00000408\PSS10R.CHM. I have posted this question before. But maybe it wasn't ...

how can i get this back (right click file
please help when I right click on a folder in XP I can choose Send to 3 1/2 floppy what's wrong with it I used to have other choices eg mail recipient & mail recipient (as attacchment) how can i get this back?? Open notepad and select Save As. Save the file as "Mail Recipient.MAPI" in your SendTo folder. I don't ever recall one named Mail Recipient (as attachment) in the Send To folder. If you had one, it was something done special since Microsoft Outlook or Outlook Express doesn't create that one. "sa" <shaunadams.mail@gmail.com> wrote in mes...

how can i get expart in ms office
"ttttttttttt" <ttttttttttt@discussions.microsoft.com> wrote in message news:5391A499-A69A-4F16-A4DC-8C9FF57C5F90@microsoft.com... <nothing> This is a completely ambiguous question. Do you mean you want to find an expert in Office or that you want to become an expert in Office. For the former, Google would be a good tool to help search for one. For the later, read published books and use the various apps extensively to discover how they work. -- Brian Tillman [MVP-Outlook] If you wish to become an expert, in addition to what Mr. Tillman has advi...

How can I get all commands to show on the menu
Other than selecting "show full menu", how do I get all commands to show on the menu? For example, the file menu does not display "save as", the tool menu does note display "options" It would help if you would tell us which version of Word you're using, as the settings vary slightly among versions. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Pam D" <Pam D@discussions.microsoft.com> wrote in message news:14C3526C-6635-4667-A40C-C140892B8621@microsoft.com... >...

How to get input events from desktop?
I am developing an application which requires to record users interaction with other display windows or desktop. I have no requirements of having actual display window, since this is just recording. Is there a way of doing that through MFC, or a dll that I can use? Look into SetWindowHookEx. joe On Sun, 12 Nov 2006 17:57:49 -0800, Farhad <fchoupani@comcast.net> wrote: >I am developing an application which requires to record users >interaction with other display windows or desktop. I have no >requirements of having actual display window, since this is just >...

How do receipts get re-created in the Journal?
Does anyone know how receipts get re-created when you see them on screen? I think the answer to this question will help as I create custom receipts. In other words, when I look at an existing receipt in the journal viewer, is it pulling data from the tansaction table, item table, etc, or is all the info from the original receipt stored somewhere. One of the mysteries I am trying to solve is why the discount code and serial number show on the printed receipt, but not on the viewable receipt. Thanks, Steve Steve, the receipt you view in the journal is taken from a compressed image of th...

Send/Receive gets stuck at 50% and hangs
I have a user who is using Outlook 2007. Quite frequently, doing a forced send/receive (clicking the button) or letting the schedule do it - down in the lower right corner you can watch the progress - it gets stuck at 50% and hangs there for about 2-4 minutes - then finishes. The user connects directly to their SBS Server (exchange), that's the only account in their Outlook profile too. Oddly enough, they are the only user w/this problem. the 11 other users on the network don't have this problem. Outlook gives no reason at all as to why it would behave like this as w...

How do I get top cell alignment in excel 2003
Can't find 'top' as an option when I go to cell alignment in Excel 2003. Some websites show 'top' as an option for cell alignment, but that must have been with an earlier version of Excel. How do i get top cell alignment with Ezxcel 2003? thanks much More info. Opened an Excel 2003 worksheet with Excel 2000 and was able to change a cell alignment to 'top'. Reopened in Excel 2003 and formatting for that particular cell showed 'top'. But, for all other cells, the 'top' option is still not available in 2003. Am I missing something or did th...

I keep getting the word page where the page number should go
I am using windows xp and just changed from word 2002 to word 2003. There are page numbers in the upper right corner in my document, but when I print the document, I get the word page printed in closed in brackets on every page. I have a HPdeskjet 940c. I have tried moving the margins around but that doesn/t seem to help. Can you help? In your Print dialog (Ctrl-P) > Options (or Tools > Options > Print), there is a checkbox labeled "Field Codes." Uncheck that. On Jan 23, 3:02=A0am, jexie <je...@discussions.microsoft.com> wrote: > I am using windows ...

How to get the array like this?
I want to use VBA to make an array like the following. Can anyone give me any advice? Thanks! 57 58 59 60 61 62 63 64 65 56 31 32 33 34 35 36 37 66 55 30 13 14 15 16 17 38 67 54 29 12 03 04 05 18 39 68 53 28 11 02 01 06 19 40 69 52 27 10 09 08 07 20 41 70 51 26 25 24 23 22 21 42 71 50 49 48 47 46 45 44 43 72 81 80 79 78 77 76 75 74 73 why? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "���˵�˫��" <rover317@hotmail.com> wrote in message news:uoQj1XVHKHA.4316@TK2MSFTNGP04.phx.gbl... >I want to use VBA to make an array like the following...

Russ, get your ASS back on here
We want some answers on this POS. God you suck. Now that will encourage him. "Someone" <someone@nowhere.com> wrote in message news:dNDfd.13114$R05.1772@attbi_s53... > We want some answers on this POS. God you suck. > Wow "someone" nice 'tude. I know the frustration but that's not gonna help. However, - Russ - it's been almost a month. Any updates would be really nice man. "Dick Watson" <littlegreengecko@mind-enufalready-spring.com> wrote in message news:%23z0ygI9uEHA.1204@TK2MSFTNGP10.phx.gbl... > Now that will enc...

how can I get excel at start up to only open excel files?
When I open excel it goes through all the files and folders in the My Documents folder including .doc files. I get message .doc files not compatible. How can I get excel to start only opening last 3 excel files instead of all file types in the specified path?? Rose Excel will attempt to open all files in the Tools>Options>General "at start up, open all files in" You must leave this dialog blank unless you want the files to start up from there. Can you get Excel opened far enough to edit this dialog? If not, you must delete/change it through the Windows Registry. St...

Getting a � in Excel '97
How can I get a "�" to show up in Excel '97 in the "currency" section o the "Format Cells" function? I am trying to show all of my values in Euros (�) and not Dollers ($ but in this version of XL, I cannot seem to find the "�" symbol. Anyone have any ideas? Do I need an add-in? I'd like to avoid "Custom Format" each time for this.. -- Message posted from http://www.ExcelForum.com Cody, Excel 2002 has a Euro currency type (Format - Cells - Number - Currency). � 2.20 -- Earl Kiosterud mvpearl omitthisword at verizon per...

Focus to Child MessageBox from SysTray Message?
I have an application, with a seperate SysTray Icon. The SysTray Icon has an "Exit Application" option that opens the main application window, and displays a MessageBox (with "Are you sure..."). The MessageBox does not prevent the SysTray icon from working, so the user can select the "Exit Application" option again. When this message comes to my app, and the MessageBox is displayed, I want to set the focus to the MessageBox. Does anyone have ideas on how to set the focus to a child window of the application? I have tried the following on the appliation window:...

How to get "MyDocuments" path of a system?
For example, i have a VC++ application installed in a system and a USER logs in and start using the app. How will i get the MyDocuments path for the particular USER?, If there are multiple USER accounts in a system. Another question i have is, While using "CopyFile" function i need to copy some files to MyDocuments folder of the system after creating a folder inside it. How can i give the path to "MyDocuments"? "donos" <dipuks@gmail.com> wrote in message news:1156868666.689366.301080@74g2000cwt.googlegroups.com... > For example, i have a VC++ applica...

Post data to a web page and get results
Hi, I'm trying to create an Excel spreadsheet. This should have a button and when this button is clicked, it should take the data in some of the cells and post them to a web page (using the HTTP POST method rather than GET). This web page does some processing on the server and returns some HTML. I'd like to get this and put it into a string, so I can parse this and update other cells in my worksheet. Is this possible in Excel 2002? Thanks, Richard ...

Keeps retriving mail from accounts I dont want to get mail from
I have outlook 2000. I have two accounts 1. Mary 2. Sales I have configured Tools/options/mail services so that I only download mail from one account, Mary (its a checkbox) This allows me to get mail from mary and to only get mail from Sales when I want it. I download mail manually by selecting Tools/send & recieve/internet mail sales. However when every outlook automatically downloads mail every 5 minutes it also downloads my sales mail. I have tryed removing the password from the login box of sales when it trys but then im just presened with the loging screen for sales. How can I d...

unable to get the chartobjects property of the worksheet class
Hi everyone, I am very new to EXCEL, please refer to the macro and help if you can. My question is I got an error message "unable to get the chartobjects property of the worksheet class" at the codes ( ActiveSheet.ChartObjects("Chart 3").Activate). This recorded macro is just select a range then make a chart out of it. Then cut and paste the chart to another area on the same sheet. I think the error message came when I select and cut the graph. I stuck at I don't know how to get the program return the chartobject property so that I can assign the name to c...

Excel Get Data
Dear all I am connecting from excel to an ODBC server and pulling off a Date field which is kept in an Integer format. Now I'm pulling this into Excel but only want to pull the unique records i.e not the same date integer twice which has been occuring. Does anyone know how to use the Microsoft Query application in Get Data of Excel to only pull unique records? Many Thanks -- Adam ----------- Windows 98 + Office Pro 97 Dear Adam One thing you could try is to open your query in MS Query, and pull the field that has the date data to the far left hand side (ie it becomes the first field...

having problems getting device capabilities from a network printer
Hi all; Let me set up my problem: I have a piece of legacy VC 6 code that prints a bitmap based on visible images. i am printing to a network printer from a desktop. when i print the bitmap does not show. however when i print from any of the laptops that my company has it prints correctly. I'm using the same set of images and printing to the same printer in all cases. I have walked the code and discovered that on the desktop everything breaks down when i do the following set of calls: int prtPPIx = prtDC.GetDeviceCaps(LOGPIXELSX); int prtPPIy = prtDC.GetDeviceCaps(LOGP...

Several updates failed and i get Error Code: 0x8007F0F1
How can i reinstall them manually? or what should i do to instal the updates that didnt get installed? Windows version? Which updates? Male26 wrote: > How can i reinstall them manually? or what should i do to instal the > updates > that didnt get installed? ...

Failed to get user's LDAP path from...
Greetings everyone! Working on the DST solution. We are having a problem with the server-side fix (read: KB930879). Here is the short version: getting the "Failed to get user's LDAP path from /O=org name/OU=Administrative Group/CN=Recipients/CN=user account". I have tried with several different user account objects (some 'Domain Admins', others not). Anyone seen this problem and have a solution? For those interested, here are the details: Test Environment: Windows Server 2003 SP1 / Exchange Server 2003 SP2. Windows XP Pro SP2 workstation running Office 200...