Unique Control Names

P

Paul

Hello,

I know that each control on a form/report has to be unique, but do they have
to be unique to the whole .mdb project? I haven't encountered any problems
with a Customers form where I can use txtCustomerId, txtFirstName,
txtLastName, and etc. I do, however, have my fields in the tables unique by
prefixing them with the name of the table they reside such as a Customers
table (i.e. lngCustId, strCustFirstName, strCustLastName, and etc.).

I am using Access 2003.

Thanks for your help.

Regards,

Paul
 
M

Mr B

Paul,

Control name only have to be unique in each form or report. The same
control name can appear in different form and/or reports.
 
J

John W. Vinson

I know that each control on a form/report has to be unique, but do they have
to be unique to the whole .mdb project? I haven't encountered any problems
with a Customers form where I can use txtCustomerId, txtFirstName,
txtLastName, and etc. I do, however, have my fields in the tables unique by
prefixing them with the name of the table they reside such as a Customers
table (i.e. lngCustId, strCustFirstName, strCustLastName, and etc.).

Neither precaution is necessary. Many people with wizard-generated forms have
innumerable controls named Label1, just for example; and using the tablename
as a prefix for fieldnames is probably preferred by a small minority.

If it works for you and helps clarify your documentation and understanding of
the database, go for it - but there's no builtin restriction on NOT doing so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top