473,799 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form/subfrom problem

I have a form (giving details of a person) and a subform (giving details of
the person's assets).
A search in the form for a particular name using the Find dialog box finds
the wanted person.
The assets are then updated and the next person's name entered into the Find
dialog box, but this fails to find the required name, because the focus is
still in the subform. The user thus has to first place the cursor into the
form and then execute the Find. This is a general nuisance.

I have tried many ways of setting the focus back to the Main form, without
success, so the user's next Find will address the right records. Does
anyone know of a way to do this? I can't even find a SendKeys way of doing
it (I would prefer not to anyway).

Hans Karman, Canberra Australia
Nov 13 '05 #1
3 1482
Simplest might be to add a Find button to the main form.

Set the command button's On Click property to:
[Event Procedure]
Click the Build button (...) beside this.
Access opens the Code window.
Add these 2 lines to the event procedure:

Private Sub cmdFind_Click()
Me.[YourNameFieldHe re].SetFocus
RunCommand acCmdFind
End Sub

It works because focus moves back to the main form when you click the
button, and then the code sets focus to whatever your name field is called
and calls the Find dialog.

If you set the Caption of the button to:
&Find
you can use Alt+F to jump to the button, so no mouse click is required.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hans Karman" <ha**@karman.au .com> wrote in message
news:41******** @news.comindico .com.au...
I have a form (giving details of a person) and a subform (giving details of
the person's assets).
A search in the form for a particular name using the Find dialog box finds
the wanted person.
The assets are then updated and the next person's name entered into the
Find
dialog box, but this fails to find the required name, because the focus is
still in the subform. The user thus has to first place the cursor into
the
form and then execute the Find. This is a general nuisance.

I have tried many ways of setting the focus back to the Main form, without
success, so the user's next Find will address the right records. Does
anyone know of a way to do this? I can't even find a SendKeys way of
doing
it (I would prefer not to anyway).

Hans Karman, Canberra Australia

Nov 13 '05 #2
Thank you for your reply.

The FIND button is on the footing of the Main Form.

The problem is that the user keeps the FIND dialog box open and uses the
FIND NEXT button to get to the next person. That FIND NEXT button isn't
visible to any code that I can find, hence there is no way that I know
of to reset the focus.

I suppose it is possible to do "my own thing" with the Find dialog, but
that is a drastic step if there is a way to use the FIND dialog. I'm
trying to make sure it isn't my lack of understanding that makes me miss
the "right" solution.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
In general, Hans, it is worth doing your own thing as an interface people
can understand.

What we generally do is to provide some unbound text boxes in the form
header section, with command buttons to Filter and RemoveFilter. When this
cmdFilter button is clicked, we build a string from the non-blank filter
boxes, and apply it to the Filter property of the form (remembering to set
FilterOn as well). Now that the form is filtered, the user can just use the
navigation buttons to move to the next record (which is the next match).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hans Karman" <ha**@karman.au .com> wrote in message
news:41******** **@127.0.0.1...
Thank you for your reply.

The FIND button is on the footing of the Main Form.

The problem is that the user keeps the FIND dialog box open and uses the
FIND NEXT button to get to the next person. That FIND NEXT button isn't
visible to any code that I can find, hence there is no way that I know
of to reset the focus.

I suppose it is possible to do "my own thing" with the Find dialog, but
that is a drastic step if there is a way to use the FIND dialog. I'm
trying to make sure it isn't my lack of understanding that makes me miss
the "right" solution.

Nov 13 '05 #4

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

Similar topics

14
3113
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
1
2486
by: zdavis215 | last post by:
I am working on an Access database. I have the main form with a text field ( NPC) and a subform with source query called NPC query. The only thing that NPC query displays is records where NPC<> 0. The way the database is working now: A user can enter a NPC and the subfrom will give all the records in the query that have the specfic NPC that the user entered. The user has to know the whole NPC code in order to view the records. I...
1
2146
by: sjvandevoorde | last post by:
I need some help with a couple forms/test fields. Bare with me I have been out of the field for some time and only consider myself an intermediate user. The first one is a subfrom which lists records including Decrease and Increase field. I have two text fields which are suppose to total each of these fields. This subform is within another form which should be displaying the current balance. The subform text feilds are: Decrease - (I...
13
3791
by: FelixS | last post by:
I have developed a way to enter the data from long medical document, using structure: Mainform (subform1,... subfromN). This is reflecting the logical model of data: Document(section1,section2,...sectionN). The MainForm has only one control, subfrom, in Detail which displays consecutively section1,...sectionN. This is done by buttons "Next" and "Previous" located in MainForm's Footer. I was quite happy with this design: subforms,...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.