Brug af AI afslører de svagheder, virksomheder allerede har opbygget gennem års cloud-transformation, nye SaaS-løsninger og fragmenterede sikkerhedssystemer.
I made a query using ALL three tables,(qryPersonArrest) your relationships were in place so that makes things easy!
Then I used the wizard to create a form based on the query. I add ALL fields from the query. The query asks if I wan to make a sub form and I can choose either person or anholdesle for th emain form. The wizard does the rest. Actually the wizard is so smart that it uses the correct tables or makes a new query as its record source, so you can throw it away (it is no longer needed). I made two forms one with person as th emain form, where you can see the arrests on that person. and another form with arrests as the main form and persons arrested!
terry>> Det du har gjort har jeg også prøvet. Hvis jeg laver det med \"person point of view\" så kan jeg se alle anholdelser tilknyttet denne person. Men jeg kan ikke tilføje en anholdelse til personen, som en anden er tilknyttet, da jeg kan kun indtaste helt nye!
Morning stigc! I was taking a look at the site and before I read so much I was thinking that it was your site, but then I noticed that Rolf mentioned that he had a brother Stig! I was VERY interested in birds when I was a kid (many years ago) but now its difficult finding the time.
Concerning the database, I understand the problem, actually I was thing about it while trying to fall asleep.(didnt get much sleep) Not because I cant solve it, I dont think thats a problem, but because I should have thought of that intead of just relying on the wizards for a fast answer. Anyway, I will take a look at it today and get back to you as soon as possible. I have a couple of meetings today, so hope you can wait!
mvh Terry P.S You want it from a person point of view?
While terry is occupied elsewhere...:o) Såvidt jeg kan se opstår dit problem i og med at du ikke har defineret nogen nøgel i den tabel der binder en person sammen med en anholdelse. Som det ser ud i den db du har lagt op, kan en person knyttes til den samme anholdelse flere gange og det kan ikke være rigtigt. Normalt ville man vel vælge kombinationen af de to fremmednøgler som nøgle, men så kan man ikke oprette poster fra den formular du ønsker. Istedet kan du (i a_p tabel))oprette en ekstra kolonne der autonummereres og sætte det til at være nøgle på tabellen. Denne løsning sikrer dog ikke at samme person ikke kan forbindes med den samme anholdelse flere gange. Så min løsning er rettet mod en hurtig løsning, istedet for en korrekt, da jeg ikke selv kan komme videre. Derfor er jeg osse interesseret i at følge dette spørgsmål, så det hjælper mig ikke meget hvis terry laver det hele offline og blot leverer spørgeren resultatet direkte. Jeg mener dette er et site for videnudveksling og ikke en lukket chat-klub.
lazac>I agree that this is a \"videnudvekslings\" site, but in some cases the solution just cant be Cut&Pasted from Access, even though it would be nice if it could, it would make things FAR easier. You could as you say create a \"duplicate\" in person_anholdelse that could be easily solved by having a primary key using BOTH fields, no need to have another ID as primary key.
I do have a couple of ideas as to how this can be solved and I assure you that you will get to see the answer, how does that sound?
terry>That sounds good, thank you :) If defining the two fields as a combined key works, isn\'t this the solution then? I have a db I use for managing licenses. It shows what software is installed on individual computers. I use a main form for the computers and a subform for the software. It is possible to \"install\" software to the computers from this form.
OK, here is one solution. As stated in my comment (20:57:34) make a form using the wizard, choose data sheet view for the sub form. In the sub form the first two fields are from the many to many relationship, you can remove the first (personID) it gets updated automatically through the main form. You can also remove the third field (anholdelse.anholdelsesid) as this is an autonumber when a record gets created. Now there is one of the ket fields left (anholdelse_person.anholdelsesid). Change this to a combo box and set the row source to SELECT DISTINCTROW [anholdelse].[anholdelsesid], [anholdelse].[startdato], [anholdelse].[slutdato], [anholdelse].[anholdelsessted], [anholdelse].[titel] FROM [anholdelse]; and control source to anholdelse_person.anholdelsesid and column widths to 0cm;2.54cm;2.54cm;2.54cm;2.54cm and list widths to 10.159cm and cloumn count to 5 I think thats enough!
Then in th esub forms after update event place the following Me.anholdelse_person_anholdelsesid.Requery (The combo box)
Now an explanation: The combo contains a list of all \"anholdelse\". The user can select one from the list which results in the anholdelse fields getting filled with the correct data.
If the user enters a new anholdlese, then the combo gets refreshed with the new data.
I\'ve briefly tried your solution, but can\'t make it work when trying to create new \"anholdelse\" entries. I\'ll check it out more thoroughly when I get home tonight.
terry: Man er nød til at programmere en Combobox_NotInList handler for at få dit eksempel til at virke. Men det virker til gengæld, for det har jeg brugt masser af gange.
I dont know what you have tried philph, but I havent used a not in list routine. If you have tried this (example) yourself then the combo contains those existing and the other fields can be used for entering a new or changing an already existing. (This is a MANY to MANY realtionship) and on the AFTER UPDATE event for the sub form I requery the combo, and it works!
Man vælger et udgangspunkt, endten kæledyr eller personer. Lad os sige at vi vælger personer:
frmPerson: Enkeltformular med subform fsubPersonKæledyr fsubPersonKæledyr: Fortløbende formularer eller dataark indeholdende ComboBox med Kæledyr
cboKæledyr LimitToList=Yes AutoExpand=Yes
Private Sub cboKæledyr_NotInList(NewData As String, Response As Integer) If NewData <> \"\" Then If MsgBox(\"Ok at oprette?\", vbQuestion..... \'*** Lav kode der tilføjer NewData til Kæledyr tabellen \'*** Ret response til ITEM_ADDED eller noget lignende. Det gør at comboen bliver Requery\'ed End If End If End Sub
Det er så meget jeg kan huske på stående fod. Jeg skal lige hjem før jeg kan få fingre i mit kodebibliotek.
You use the combo to select an existing \"anholdelse\", or you can enter an new by filling out the other fields. When you do this the new gets added to the list of existing, without any NOT IN LIST.
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.