B
Brad
Hi
When I change from my company screen to the contact screen, i have managed
to get it to opne the contact form with the contact details from the previos
screen.
This is in my code to do this:
stLinkCriteria = "[ContactID]=" & Me![ContactID]
stDocName = "Contacts"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
However, when I try and do it the other way around with this:
stLinkCriteria = "[CompaniesID]=" & Me![CompanyID]
stDocName = "Company"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Its coming up with a compile error.
However I have tried to put it in so that I can do the same from contact to
company (i.e. when I am on a contacts details, I can click there company name
and it goes to the company screen showing there details). The company index
field on the contacts table is called 'CompanyID' and the company index field
on the company table is called 'CompaniesID'.
Anyone know what I am doing wrong?
Just to clarify, what I want to do is:
Open Contact form, choose contact. Click on contact company and then this
opens the Company form, showing details of that particular company. At the
moment the company form opens, but it just shows the first record.
Appreciate your help with this, I am very new to Access.
Thanks
Brad
When I change from my company screen to the contact screen, i have managed
to get it to opne the contact form with the contact details from the previos
screen.
This is in my code to do this:
stLinkCriteria = "[ContactID]=" & Me![ContactID]
stDocName = "Contacts"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
However, when I try and do it the other way around with this:
stLinkCriteria = "[CompaniesID]=" & Me![CompanyID]
stDocName = "Company"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Its coming up with a compile error.
However I have tried to put it in so that I can do the same from contact to
company (i.e. when I am on a contacts details, I can click there company name
and it goes to the company screen showing there details). The company index
field on the contacts table is called 'CompanyID' and the company index field
on the company table is called 'CompaniesID'.
Anyone know what I am doing wrong?
Just to clarify, what I want to do is:
Open Contact form, choose contact. Click on contact company and then this
opens the Company form, showing details of that particular company. At the
moment the company form opens, but it just shows the first record.
Appreciate your help with this, I am very new to Access.
Thanks
Brad