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. I’m not
sure what the full module would look like for this OpenReport command, if I
need to write one rather than use a macro. Thanks! ~ amjjam
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. I’m not
sure what the full module would look like for this OpenReport command, if I
need to write one rather than use a macro. Thanks! ~ amjjam