473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SetFocus at [Find What:]

Hi,

I wrote a Sub to run "Find and Replace" menu command on Access 2000.
It worked fine except SetFocus didn't work. It changed position from
time to time. I need the Focus always set at [Find What:] field

Here is the Sub:
'Find What: Need Code to SetFocus here???
'Look In: current field only
'Match: Any Part of Field
'Search: All

DoCmd.DoMenuItem acFormBar, acEdit, 9
SendKeys "{Tab 1}{Up}{Enter}{Enter}"

Can anyone provide SetFocus code?
Thanks
Nov 12 '05 #1
3 2473
bo*******@yahoo.com (Eric) wrote in
news:2a**************************@posting.google.c om:
Hi,

I wrote a Sub to run "Find and Replace" menu command on Access
2000. It worked fine except SetFocus didn't work. It changed
position from time to time. I need the Focus always set at
[Find What:] field

Here is the Sub:
'Find What: Need Code to SetFocus here???
'Look In: current field only
'Match: Any Part of Field
'Search: All

DoCmd.DoMenuItem acFormBar, acEdit, 9
SendKeys "{Tab 1}{Up}{Enter}{Enter}"

Can anyone provide SetFocus code?
Thanks


No guaranteed way exists to set focus to your control.
Since you are writing code anyways, study the help file for how to
use the .findfirst and .findnext methods. You can easily provide a
far better solution than the built-in find box.

Bob Quintal
Nov 12 '05 #2
Me!MyControl.SetFocus?
Nov 12 '05 #3
TC
I think the OP wants to set focus to the "Find What" field of the standard
"Find and Replace" popup. So he does not have a control reference to use
..Setfocus on.

TC
"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
Me!MyControl.SetFocus?

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Corepaul | last post by:
I am a newbie using Access 2000. I am using the following test in the txtAlbum OnExit procedure to prevent leaving an empty text box for a required field If (IsNull(txtAlbum.Value)) Or...
3
by: jaffer the but | last post by:
Hi whats the new alternative to setfocus in vb.net ? thanks in antisipation - j
4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
8
by: Shachar | last post by:
Hi All, I need to start a new process calc for example and when ever the user click on the button the application should setfocus to the calc application. I use this code but it is NOT...
0
by: z.ghulam | last post by:
Hi, I'm creating a new databse and have a couple of problems I'd greatly appreciate any feedback on. 1) I have an order form and would like to set it, so that when the form is opened, the focus...
0
by: MrsLeigh | last post by:
I have a datagrid on a web page. In the footer there is a field that should be recieve the focus, either at the start or after a button is clicked to insert the row that is being added in the...
1
by: SDL | last post by:
The code below says error 2108 must save field before setfocus? All I want to do is check out the input field and if in error set the cursor back on it after the MsgBox displays. In this case I...
3
by: Jim Devenish | last post by:
In my application vehicles arrive and depart from a workshop. The ArrivalDate and the HandoverDate are each entered. Sometimes the person who should enter the arrival date forgets to do so. ...
5
agroover
by: agroover | last post by:
I can't seem to figure out how to get rid of the errors. I recieve the following error when I leave the Grade.SetFocus in my code... Microsoft Access can't move the focus to the control Grade ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.