19. september 2005 - 14:06Der er
8 kommentarer og 1 løsning
Hvordan låses kun specifikke felter/rækker i relateret Subform
Hej, Jeg har en form med en subform i. Jeg ønsker at kunne låse visse felter på "main" formen hvis en "Approved" checkbox er afkrydset. Dette går fint, MEN i Subformen kan der være fra 0 til flere rækker af tillæg. Sådan som det kører nu kan jeg kun ENTEN låse alle felter/rækker i Subformen eller ingen. Jeg vil godt kunne lade nogle være låst og nogle ej-låst/ej locked. Koden kører på main formens On Open kode og ser nogenlunde sådan ud: If Me.CheckGodkendt.Value = True And Me![FrmTillaegUnder Subform]!App.Value = True Then Me.FrmTillaegUnder_Subform!Amount.Enabled = False Forms!FrmOrdre!OprinKontraktbeloebDKK.Enabled = False Mvh. Trine
I lang tid har samarbejdsbranchen fokuseret på at forbedre enhedsfunktioner – bedre kameraer, klarere lyd og smartere software. Men den virkelige forvandling handler ikke om funktioner.
Ah! so you also need to check on a value in the sub form. OK, then you need to do this in the forms On Current Event and then set the value appropriatly
Hi Terry, yes it's been a while, but now I'm back in business (I hope) Why in the On Current Event instead of the On Open, and where? It doesn't seem to work if I put it in the SubForms On Open Event? And what does the "parent" thing do? A lot of questions I know, but I've been away for so long
The reason for this is because if you try locking a field on the sub form then all records are locked? If you do it in the sub form then the field in all records will still get locked/unlocked but it will change depending on the values in the main form and the current detail records field values.
Hope you understand that.
parent is just a method for refereing to the main form in which the sub form is placed. So the sub form is classed as a child to the main form (parent).
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.