Where can I find this?

de049

Registered User.
Local time
Today, 05:43
Joined
Sep 24, 2001
Messages
18
Hi,

Where in a database would i find this code: Forms!frmCompanies!Search2

It keeps appearing when I try to open my form. It has been happening ever since I change my table/form names in the DB to better suit my new project. Where can I find this and what do I need to replace it with.

My form is called frmPRI.
 
Open the code window from the form in question and change frmCompanies to the name you changed it to. Or, your form could be based on a query with that set as the criteria. If so, open the query and change as above to the forms new name.

HTH
 
Last edited:
That won't help. The thing is, is there not a way to change field/form/table names and so to all the objects related to that field/for/table????? I have sample DB that I got on here, but its proving murderous to change the fields to names that better suit my design.

Please help
 
It'll probably be in a query as a parameter. It could also be in a module where some code builds a query.
 
If you change form, table names etc. from within the db, all references to them will have to be manually changed. I know of no other way.
 
Where in a database would i find this code: Forms!frmCompanies!Search2

There are only two places where it can occur:

1. In the form that is currently open.

2. In something that is opened implicitly by the currently open form.

I'm saying that because this construct is meaningless unless the frmCompanies form happens to be open at the time. Otherwise, it is not a member of the Forms collection. Only of the Documents collection.

Under #1, you have the class module of the form itself, plus any controls that are bound in a parent/child relationship to something else (perhaps even via pop-up forms). This LOOKS like a reference such as a child form might make regarding a selection made on a parent form, but that is not the only place such a selection could occur.

Under #2, you have the general modules (all of them), queries that underly a control, and queries, forms, or reports triggered by event code in the class module of the open form.

I would open the form in design mode and look at the recordsource for the form and the controlsource for each control. If that doesn't work, I would next open the class module and search it for that exact string. (You can tell the search to go through the whole module.) Next, I would open any general modules and search them, one at a time (to prevent myself from becoming more confused than normal for me.) ;)

Next, I would look at what the form does along the lines of opening other objects. I would repeat the class-module search for those objects, as well as the recordsource and controlsource examination.

When the object opened by your form is a query, I would look at the SQL code, too. When the object is a report, it can also have a class module, a recordsource for the report, and controlsource entries for each control.
 
A2K and newer versions do support a limited cascading change ability. If you are using A2K, you MUST upgrade to the latest service pack which I think is 3. Earlier versions of Name Auto Correct caused strange bugs. Read this article:
How Name AutoCorrect Works in Microsoft Access

To find the reference that is causing your problem, I would open the form properties and look at the data tab. Remove any filter or sort.
 
Whoops! Pat's right. I forgot 'bout filters and sorts. They can also have a direct reference to a control this way.
 

Users who are viewing this thread

Back
Top Bottom