By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Form/Subform Searching

P: n/a
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.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

Nov 13 '05 #2

P: n/a
Thanks Ed!
Nov 13 '05 #3

P: n/a
(Top-posted to follow previous response)
Remember, that if you use the following type of join,
"show all records from X, and only related records form Y"
then the recordset is no longer updateable (I think).
Fred Zuckerman

"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:0E******************@newshog.newsread.com...
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.


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.