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

Form/Subform Searching

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
3 2779
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
Thanks Ed!
Nov 13 '05 #3
(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Josh C. | last post by:
Hello everyone. I'm a bit of an Access newbie, so please bear with me. Please go to http://www.dumoti.com/access/ to view the database - 536kb. I'll go straight into examples: In the form...
5
by: ego | last post by:
Hi all , I had created the following Form/SubForm structure : MainForm SubForm A (SubForm of MainForm) SubForm B (SubForm of SubForm A) SubForm C (SubForm of SubForm B) SubForm D ...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
10
by: Thelma Lubkin | last post by:
My form/subform combination that allows user to display 'ColorSet' records, move to other records via a selector, to add,delete, and edit them, and to manage the related 'Color' records from the...
3
by: ghat12 | last post by:
Hi, I have created a form containing 5 textfields/combo boxes and a command button to conduct searches for matching records. My results are currently displayed as a separate datasheet which is...
5
by: Ron | last post by:
Hi All, I've got a form called frmCust that has a subform on it called sfrmBalance. sfrmBalance's control source is a query called qryTrans4CustBal. sfrmBalance has one field on it called...
2
by: hawg1 | last post by:
I'm fairly new to Access and need help with form/subform. I've seen another access database in which a main form allowed the user to enter school class specific information shuch as start date,...
3
by: Steve | last post by:
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks!
1
by: troy_lee | last post by:
I have a table (Table A). It has one field, a PK. It is in a 1:M with another table (Table B). I am having trouble with a form/subform setup to view the 1:M records. On the parent form, there is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.