I have a Form called Clients. It is bound to the table Clients. It has a Tab Control on it. The first page(tab) contains all the fields in the Clients table.
I want the second page to display the fields from another table called Contacts. To this end I have put a SubForm onto the second page, whose Source Object is a Form called "Demo" which displays all the fields in the Contacts table.
The "Demo" form has a list box on it which when you click on a name it populates all the other fields on the Form with data. Although it works fine as a "stand-alone" form, when it is included within the "Clients" tab control I get a "..could not find the Form 'Demo'..." error.
Below is the code that is behind the ListBox click event:
Set DB = CurrentDb
Set MyRs = DB.OpenRecordset("Contacts", dbOpenDynaset)
strCriteria = "[ContactID]= " & (Me!List2) & ""
MyRs.FindFirst strCriteria
Forms!Demo.Bookmark = MyRs.Bookmark
MyRs.Close
It falls over on the Bookmark line. I have tried referencing it Forms!formname!subformname.Bookmark but get a "Object does not support this property" error. Can someone be my knight in shining armour...?
I want the second page to display the fields from another table called Contacts. To this end I have put a SubForm onto the second page, whose Source Object is a Form called "Demo" which displays all the fields in the Contacts table.
The "Demo" form has a list box on it which when you click on a name it populates all the other fields on the Form with data. Although it works fine as a "stand-alone" form, when it is included within the "Clients" tab control I get a "..could not find the Form 'Demo'..." error.
Below is the code that is behind the ListBox click event:
Set DB = CurrentDb
Set MyRs = DB.OpenRecordset("Contacts", dbOpenDynaset)
strCriteria = "[ContactID]= " & (Me!List2) & ""
MyRs.FindFirst strCriteria
Forms!Demo.Bookmark = MyRs.Bookmark
MyRs.Close
It falls over on the Bookmark line. I have tried referencing it Forms!formname!subformname.Bookmark but get a "Object does not support this property" error. Can someone be my knight in shining armour...?