alswedi قام بنشر ديسمبر 2, 2003 قام بنشر ديسمبر 2, 2003 اخوتي الأعزاء . السلام عليكم ورحمة الله وبركاته . وبعد كيف يمكنني عمل كود يقوم بربط جدولين بعلاقة واحد الى متعدد . ولكم جزيل الشكر 1
محمد طاهر عرفه قام بنشر ديسمبر 3, 2003 قام بنشر ديسمبر 3, 2003 هذا هو الكود للربط و أيضا كود لطباعة العلاقات الي نافذة ال debug 'create a relation '================= Sub CreateRelationDAO() Dim dbsLocal As Database Dim relLocal As Relation Dim fldLocal As Field Set dbsLocal = CurrentDb Set relLocal = dbsLocal.CreateRelation() With relLocal .Name = "PeopleFood" .Table = "tblFoods" .ForeignTable = "tblPeople" .Attributes = dbRelationDeleteCascade End With Set fldLocal = relLocal.CreateField("FoodID") fldLocal.ForeignName = "FoodID" relLocal.Fields.Append fldLocal dbsLocal.Relations.Append relLocal End Sub 'print relation '================ Sub EnumRelations() Dim dbsLocal As Database Dim relLocal As Relation Set dbsLocal = CurrentDb For Each relLocal In dbsLocal.Relations Debug.Print relLocal.Table & " Related To: " & relLocal.ForeignTable Next relLocal End Sub
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.