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

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 1463
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.[YourNameFieldHere].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
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 ;...
1
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. ...
1
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...
13
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: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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,...
0
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...

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.