on click SQL error

A

amjjam

Hi,

I have a contacts form with 3 tabs: 1) contact’s name and business
information; 2) communications – a subform; and 3) contact’s general
information. The communications subform requires the ContactsID number so
data is linked and stored appropriately in the underlying communications
table. Form tabs 1 and 3 have a task button labeled View Contact Fact Sheet.
I have linked the button to an on click macro to open the Contact Fact Sheet
in print preview. It reads:
Action: OpenReport
Report Name: Contact Fact Sheet
View: Print Preview
Filter: (blank)
Where Condition: [ContactsID]=[Forms]![Contacts]![ContactsID]
Window Mode: Normal

When I click on the button to open the contact fact sheet, I get an error
message which reads: The specified field ‘[ContactsID]’ could refer to more
than one table listed in the FROM clause of your SQL statement. Can anyone
tell me how to get this button to work? When I hit the help button on the
error message, it indicates that the SQL statement must specify which table
the ContactsID should be drawn from. I tried using code builder to insert:

Private Sub ViewContactCommand_Click()
SELECT Contacts.ContactsID FROM Contacts, [ContactsID];
End Sub

That gives me a syntax error and I don’t know if I need to delete the macro
altogether to test run that appropriately. Working with Access 2003 is new
for me, so if you can give detailed instructions, I’d appreciate it. Thanks!
~ amjjam
 

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