1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2007, command button problems

Discussion in 'Business Applications' started by alcollett, Nov 2, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. alcollett

    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
     
  2. Rockn

    Rockn

    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.
     
  3. alcollett

    alcollett Thread Starter

    Joined:
    Nov 2, 2011
    Messages:
    4
    Thanks for that, i will go and have a look
     
  4. alcollett

    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
     
  5. Rockn

    Rockn

    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.
     
  6. alcollett

    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
     
  7. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1025080

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice