01. december 2002 - 17:41Der er
23 kommentarer og 1 løsning
Indsætte data i underformular
Jeg har tre tabeller, kunde, rejse og tilmelding. 'Kunde' indeholder kundens stamoplysninger, 'Rejse' indeholder rejsen stamoplysninger og 'Tilmelding' inderholder id fra Kunde og Rejse samt andre oplysninger.
I min kundeformular vil jeg gerne vise de rejser den aktuelle kunde er tilmeldt i en underformular.
if I understand your question correctly yu have a many to many relationship. If you have designed your tables correctly the you should be able to use the form wizard to make your forms.
Christian, take a look at the data type for RejseID in the Tilmelding table (text) and in the Rejse table (Autonumber, long int). They MUST be the same data type to make a JOIN. You must make sure your tables and relationships are correct and I am sure the wizard will work once they are.
If the wizard deosnt work make a query containing all the fields from Rejse and only the Kunde from tilmelding, this field is needed to join to the kunde on the main form. You can hide thsi field in the sub form!
No! Like this SELECT Rejse.*, Tilmelding.kundeid FROM Rejse INNER JOIN Tilmelding ON Rejse.Rejseid = Tilmelding.rejseid;
Use the query builder to do this. Drag both tables into the query window, if your relationships are correct then you will see a thin line joining the two field. Drag the * (all fields) from the Rejse table and the kundeID from Tilmelding. Have you altered the data types?
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.