473,394 Members | 1,693 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,394 software developers and data experts.

how to set focus on field when searching database

Hi
In a database form I want to be able to highlight a field, select a find and replace control and on entering a search value be able to display the next record satisfying the search criteria with the focus set on the field used in the search. Is this possible please?
Aug 13 '13 #1

✓ answered by jimatqsi

It may be that you can use the PreviousControl property for this purpose. Save the name of the control that had the focus prior to the find/replace control; then set the focus to that control after the find/replace returns.

This Microsoft link may help.
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

5 1831
Rabbit
12,516 Expert Mod 8TB
You can use the SetFocus method of a control to give it focus.
Aug 13 '13 #2
Thanks for your quick reply. Can you let me know how to preserve the db/record/field value so that when the record is found I can use that value in a setfocus command. To be more specific, at present, I select a field in a record, use find&replace to enter the value I want to find; this finds a record which contains the corresponding field with that value but does not set focus on that field.
Aug 16 '13 #3
Rabbit
12,516 Expert Mod 8TB
Can you let me know how to preserve the db/record/field value so that when the record is found I can use that value in a setfocus command.
I have no idea what that's supposed to mean. The value in a field has nothing to do with focus. Just use SetFocus on the control right after your VBA code that does the find.
Aug 16 '13 #4
jimatqsi
1,271 Expert 1GB
It may be that you can use the PreviousControl property for this purpose. Save the name of the control that had the focus prior to the find/replace control; then set the focus to that control after the find/replace returns.

This Microsoft link may help.
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
Aug 16 '13 #5
I was confusing the boxes on a form containing fields with the fields themselves. Using the PreviousControl property did the trick. Many thanks for your help.
Aug 23 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jballard | last post by:
Hello, I have a database set-up with a form and two subforms in it. I have one of the subforms (replacement parts) set-up where you can pick part numbers from a drop down box and also pick a...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
1
by: Thierry | last post by:
Hi, I've got the next problem: I have a datetime field in my database (sql-server) and I want the option in it that this field can be empty. But if I leave that datetime field empty I get...
6
by: QT | last post by:
Dear sirs, I want to create panel or label field for each database records. I am using following codes for each database row to create panel field. 'Panel ' i = 1
10
by: Phil Latio | last post by:
How do I use wildcards when searching in array? At least that's what I think I need !! I have the line: if ($attribute != "id") The above is not 100% correct because it should also be...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
5
by: mail2kondeti | last post by:
Hi Here I need know small clarification. I did this long time back. If I want to show the cursor in the first field when the page gets loaded, how we have to do? Ex. if you goto...
4
by: sirvi | last post by:
what validation rule can be used to show :we cannot enter a data in a field, when another field does not have data.for example we can not enter details of a person untill we dont enter his name.
0
by: Sandra Osorio | last post by:
Am Using MS Access and got a field which uses a drop list (yes/no field). When I select the “No” option, I’d like to jump into a different field (The name of this field is “fumaba”). How can I jump...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.