Well, let's clear up a few things. The wizard built Find button has the
"Screen.PreviousControl.SetFocus" line to return the cursor to the control
that had the focus before the Find button was clicked. Without it, after
the Find dialog has closed, the Find button will still have the focus and
the user will have to move the cursor back to the main form control(s).
"Find " defaults to the current control (or all controls) when it is
activated. If you always want to search on [Surname], why not use the Combo
box wizard to create a "locater" where users choose from a surname list?
If your main form now shows all records (not just those with related subform
records) then Find will also find and show them. If your main form's record
source is a query, and that query has joined two tables to show only records
that share a value, then your form will only show those records. To show
all records, change the query join to "show all records from X, and only
related records form Y".
-Ed
"Simone" <se**********@gmail.com> wrote in message
news:e7**************************@posting.google.c om...
Hi All,
I have a Find Record button setup in most of my forms in order to find
a specific customer's details. I have just noticed today though that
this search will only find the customer if it already has linked data
in the subform. This totally defeats the purpose of my search, which
is to find an existing customer's details in order to enter new data
in the subform.
I was wondering if there is a way, in the form/subform situation, to
find an existing customer and bring up their details and a new record
to be linked in the subform. Or must I resort to seperate forms???
This is my existing find record code from using the button wizard so I
don't actually understand it.
DoCmd.GoToControl "Surname"
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
The GoToControl I had to change from the generic wizard code which was
Screen.PreviousControl.SetFocus
and did not work.
This situation occurs for forms that are sourced from a query and
directly from the table. Using access 2000.
Thanks.