Access 2007, command button problems

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

alcollett

Thread Starter
Joined
Nov 2, 2011
Messages
4
Hi there, I am a relatively new user to access 2007 and am having trouble with a command button.

Basically I have created a table of items with the reference field set to autonumber and also the primary key, from this table I created a form to enter all my items in, this works fine. the table and form were named event details.

Next I created a query to show a listof specific data, the ref, name and date of my items and used it to create a tabular form, this also works fine. I named this all events

Next i wanted to add a command button next to each entry on this form that when pressed would open the specific form, i used the wizard to do this but it wont work and I keep getting the error message,

The specified field '[Ref] could refer to more than one table listed in the FROM clause of your sql statement.

Can anyone point me in the right direction, in basic terms as not overly confident with VBA.

many Thanks

Alan
 
Joined
Jul 29, 2001
Messages
21,334
Use a consistent naming convention for naming objects in your database and you will avoid this problem. Also never create a field name in your tables with the same name as any other objects in your database which is what I think you have probably done. I am not sure what the command buttons are trying to reference so it is probably bad naming conventions if you are getting that error.
 

alcollett

Thread Starter
Joined
Nov 2, 2011
Messages
4
Use a consistent naming convention for naming objects in your database and you will avoid this problem. Also never create a field name in your tables with the same name as any other objects in your database which is what I think you have probably done. I am not sure what the command buttons are trying to reference so it is probably bad naming conventions if you are getting that error.
Thanks for that, i will go and have a look
 

alcollett

Thread Starter
Joined
Nov 2, 2011
Messages
4
Rockn,

Thanks for the help, I changed the name of the field and it now works fine, your help was very much appreciated.

Alan
 
Joined
Jul 29, 2001
Messages
21,334
For naming objects like tables I do something like tbl_tablename and forms frm_Formname. Also try and keep spaces out of naming things in your databases.
 

alcollett

Thread Starter
Joined
Nov 2, 2011
Messages
4
Thanks Rockn,

I have adjusted the names of tables and forms etc, and also deleted the spaces, certainly makes it easier, it is now working fine so thanks very much

alan
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top