Fully understanding #Name? (1 Viewer)

christakis

Registered User.
Local time
Today, 13:37
Joined
Oct 23, 2009
Messages
72
Hi guys,

I created a quick form using the wizard. I then cut/pasted all components in another form and I get a #Name? error.

I deleted the wizard form completely so that the components are not duplicated. Combo-boxes row source works fine but the component still refuses to link to the table. I checked all properties one by one and they were exactly the same in both forms. What determines in which forms the cboxes work or not?

Cheers,
Chris
 

wiklendt

i recommend chocolate
Local time
Today, 22:37
Joined
Mar 10, 2008
Messages
1,746
you may have cut and pasted your control from one form to the other, but did you set the record source for the form at all?
 

DCrake

Remembered
Local time
Today, 13:37
Joined
Jun 8, 2005
Messages
8,632
The #Name usually indicates that the control on the form is being treated as a bound object and the controlsource does not exist in the forms recordsource. If you click on the control source of the offending control in the porperties list you should get a list of selectable fields, if the defaulted one does not appear then that is the fault.

David
 

KenHigg

Registered User
Local time
Today, 08:37
Joined
Jun 9, 2004
Messages
13,327
Did you make sure you had the new form bound to the same table/query as the original one?

Edit - Seems we all jumped in at the same time. Sorry :)
 

christakis

Registered User.
Local time
Today, 13:37
Joined
Oct 23, 2009
Messages
72
Thank you all for your replies. No reason to apologize mate :) I see a pattern here. I probably didn't bound the new form with the table. How do I do this? The new table has tabs. Can i bound a different table to each tab?

Cheers,
Chris
 

namliam

The Mailman - AWF VIP
Local time
Today, 14:37
Joined
Aug 11, 2003
Messages
11,695
can only bind a table to a form (as the recordsource in one of the property tabs)
 

christakis

Registered User.
Local time
Today, 13:37
Joined
Oct 23, 2009
Messages
72
can only bind a table to a form (as the recordsource in one of the property tabs)

Hm... Is there a way to refer to the table directly from the control source (Not bound a table to the form)? I want to have all forms for all tables in different tabs in one form. Trying to avoid the situation of creating one form for each table then putting each one as a subform in one big form.
 

namliam

The Mailman - AWF VIP
Local time
Today, 14:37
Joined
Aug 11, 2003
Messages
11,695
Trying to avoid the situation of creating one form for each table then putting each one as a subform in one big form.

That is basicaly the only way to do it...

Unless you can make proper joins between the tables in one big query. Then you can have the query as recordsource leading into the tables.
 

christakis

Registered User.
Local time
Today, 13:37
Joined
Oct 23, 2009
Messages
72
That is basicaly the only way to do it...

Unless you can make proper joins between the tables in one big query. Then you can have the query as recordsource leading into the tables.

Alright thanks for the tip. The query method sounds too complicated for what it will be doing. I did create one query like that but it is dependent on unbound combo boxes in other forms so I cant use it.

Cheers,
Chris
 

DCrake

Remembered
Local time
Today, 13:37
Joined
Jun 8, 2005
Messages
8,632
I see this situation all the time where users have created queries that rely on a certain form being open as it references certain controls on that form that act as a filtering parameter.

What this means is that query can only be used in that instance, and the workaround is to create a duplicate query but reference a different form. Not only is this wrong but it clutters up the database.

The preferred method I use is to use public variables and functions, a concise explanation with a sample application with full documentation can be found Here. This methodology allows you to set up a template query and pasds information to the query from a form which allows other forms/queries/reports to respond to the filter conditions irrespective of the calling form. Take a look at it it may help you.

David
 

christakis

Registered User.
Local time
Today, 13:37
Joined
Oct 23, 2009
Messages
72
I see this situation all the time where users have created queries that rely on a certain form being open as it references certain controls on that form that act as a filtering parameter.

What this means is that query can only be used in that instance, and the workaround is to create a duplicate query but reference a different form. Not only is this wrong but it clutters up the database.

The preferred method I use is to use public variables and functions, a concise explanation with a sample application with full documentation can be found Here. This methodology allows you to set up a template query and pasds information to the query from a form which allows other forms/queries/reports to respond to the filter conditions irrespective of the calling form. Take a look at it it may help you.

David

Thank you for this. I have a look at it.

Chris
 

Users who are viewing this thread

Top Bottom