Hi Everyone,
I try to set a subtable (tbl2) to tbl1 connected with "ID_Nr", but receive an error code: 3385 Description: User-defined properties do not support a Null value. How should I set the subtable and set the connection?
Code:Sub set_SubdatasheetName() Dim db As DAO.Database Dim tbl As DAO.TableDef Dim ppty As DAO.Properties Set db = CurrentDb Set tbl = db.CreateTableDef("tbl1_name") Set tbl2 = db.CreateTableDef("tbl2_name") Set ppty = tbl.CreateProperty("SubdatasheetName", dbText, tbl2) tbl.Properties.Append ppty Set ppty = tbl.CreateProperty("LinkMasterFields", dbText, "ID_Nr") tbl.Properties.Append ppty Set ppty = tbl.CreateProperty("LinkChildFields", dbText, "ID_Nr") tbl.Properties.Append ppty Set db = Nothing Set tbl = Nothing Set ppty = Nothing End Sub
Thank You!


Reply With Quote

