Hallo.
tbl_Person
pky_Person : Primärschlüssel
txt_Person : Name
tbl_Bett
pky_Bett : Primärschlüssel
txt_Bett : Bezeichnung
tbl_Person_Bett
fky_Person_Bett_Person : Long Integer, 1:1 auf pky_Person
fky_Person_Bett_Bett : Long Integer, 1:1 auf pky_Bett
Mit tbl_Person_Bett ein Formular aufmachen, das zwei Kombinationsfelder enthält. cof_Person hat die Quelle SELECT pky_Person, txt_Person FROM tbl_Person ORDER BY txt_Person; enthält zwei Spalten, von denen die erste die Breite 0 bekommt. cof_Bett hat die Quelle SELECT pky_Bett, txt_Bett FROM tbl_Bett ORDER BY txt_Bett; gleiche Spaltenanzahl und -breiten wie oben.
Im Formular die
Sub_cof_Person_AfterUpdate()
cof_Person.RowSource=„SELECT pky_Person, txt_Person FROM tbl_Person WHERE DCount(“*",„tbl_Person_Bett“,„fky_Person_Bett_Person“+Str$(cof_Person))+"=0 ORDER BY txt_Person;"
cof_Person.Requery
Me.Refresh
End Sub
und die
Sub cof_Bett_AfterUpdate()
cof_Bett.RowSource=„SELECT pky_Bett, txt_Bett FROM tbl_Bett WHERE DCount(“*", „tbl_Person_Bett“,„fky_Person_Bett_Bett“+Str$(cof_Bett))+"=0 ORDER BY txt_Bett;"
cof_Bett.Requery
Me.Refresh
End Sub
Das Ganze als Endlosformular. Mit jeder vergebenen Kombination Person Bett wird die Auswahl geringer …
Ungetestet, sollte aber grundiziell funktionieren.
Gruß Eillicht zu Vensre