Avatar billede overchord Nybegynder
17. juni 2004 - 15:12 Der er 4 kommentarer og
1 løsning

[Access 97] UserInput + Data fra tabel til en anden tabel.

Hejsa

Jeg har en tabel med en raekke artsnavne. Naar brugeren skal indtaste koncentrationen af arter. Problemet er at artlisten kan aendre sig med tiden og kun de navne som moeder et givent kriterie skal medtages fra tabellen. Tricket er at ALLE disse felter skal inkluderes ogsaa selvom de er blanke (hvilkelt skal vaere et nul).
Listen af artsnavne er atlsaa en raekke felter hvor man kan indtaste koncentrationer. Problemet er saa at baade artsnanvn og koncentration skal nu overfoeres til en anden tabel - og jeg kan ikke lige helt gennemskue hvordan og hvorledes jeg kan faa det til at virke.
Tabellen med arter har flg felter
Analysed_Species:
ID (Autonr)
Species (Text)
OS (Tes/No) - hvor OS skal vaere = true for at tages med i listen

Data skal sendes til en tabel Plankton_Analysis med flg felter
ID (AutoNr)
Haul (Long integer) - skal udfyldes af brugere
Species (arterne fra listen)
RawCount (Double) indtastes af brugeren

Jeg har kigget lidt paa at autogenerere en form udfra listen af arter og saette dens recordsource til Plankton_analysis, men det duer ikke fordi hvert artsnanv er en ny post i denne tabel...

Nogle forslag til hvordan jeg kan lave den?
Spoerg hvis det er totalt taaget :-)
Avatar billede terry Ekspert
17. juni 2004 - 20:41 #1
Its "totalt taaget" :o)


Its not easy to give a solution without an understanding of what exactly the application is used for.

Am I right in saying that for each HAUL a record is inserted into Plankton_Analysis for every record which exists in Analysed_Species at the time of the haul registration?

If thats the case, then isnt it just a SELECT .... INTO

Whats the third table meant for?
Avatar billede overchord Nybegynder
17. juni 2004 - 22:47 #2
Terry - yes after reading it again myself i realised it was all a load of nonsense!

I think you may be onto something here... If i, as you say insert all the records from Analysed_species into Plankton_analysed at the point where a new haul is added it could work. There is still a problem with the fact that each record would be shown individually. Ideally i would like all the species in the list to be shown together for one haul in spite of actually being numerous records in the planton_analysis table. Is there a way to do that? (E.g. show x number of records at once - perhaps in a quasi-continuous form?? x-could easily be derived by Dcount)
Avatar billede terry Ekspert
18. juni 2004 - 14:20 #3
Lets say you have a main form with Haul information (date, place etc.) This has a sub form which will show the information from tabel Plankton_Analysis. So it will only show the records related to the haul record displayed on the main form.

When you create a new haul an append query is executed which would append ALL of the records from Analysed_Species, which would then be displayed in the sub form ready for enetering RawCount.


The only other way I can think of is IF a new species is added to Analysed_Species then a new field is added to Plankton_Analysis. So you would have one field in Plankton_Analysis for each species. When a new field is added to existing records then it would get a default value of 0 so that existing records arent effected. This method allows a haul to be displayed on one record, but if there are many species it may be a LO....NG record.

I must admit I prefer the "normalized" method as this also allows for additionla feilds such as comments for each species.
Avatar billede overchord Nybegynder
21. juni 2004 - 13:16 #4
Hi Terry

Thanks for that - I think the method using a subform and an append-query is the way i'll go. The number if species are not likely to change hugely, but i will have to perform similar tasks on some other groupings at a later stage which is why it would be nice to be able to keep my option open :-)
Avatar billede terry Ekspert
21. juni 2004 - 13:22 #5
selv tak.
Avatar billede Ny bruger Nybegynder

Din løsning...

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.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester