19. oktober 2003 - 12:27Der er
22 kommentarer og 1 løsning
Richt text box control
Har tilføet 2 Rich text box controls på min form af typen Microsoft rich textbox control, version 6 på min access form, begge er boundet til to memo felter i min tabel.
Når jeg scroller gennem mine records kommer den med 2 fejlmeddelelser "Property cannot be set" så klikker jeg ok. Og mine to controls viser havd de skal vise.
Ok har jeg lige prøvet, problemet er at fejlen opstår inden jeg kommer ind i "on_current" eventet, har lige prøvet på en test form og der brokker den sig ikke over rich text box control.
Nej det kan desværre ikke lade sig gøre "firma ting", tror jeg fyrer et event af et eller andet sted som gør noget som mine nye controller ikke kan lide... spørgsmålet er hvor. Lidt svært at debugge når den bare siger "Property cannot be set" ??
NO! I cant see what you are doing so its hard to say where you should try debugging from.
You say you tried on a test form where no error occurs! If that is correct then it sounds to me as though you are trying to do something in code which isnt allowed! Have you used your own code? If so take a look at that!
Ja jeg bruger min egen kode. Er kommet et skridt videre jeg bruger 4 "tabs" på min form, hvis jeg står på den tab hvor jeg har mine controller så dukker fejlen ikke op ? Så skal de være synlige før de kan settes ? Har ikke leget så meget med rich text boxe før
I dont think I have EVER used rich text boxes before!
Again, it isnt easy to make suggestions WITHOUT seeing what you are doing!
How do you know that the error has anything to do with the rich text controls?
There is ONLY one way to find the problem and that is debugging! You can also comment out pieces of code to see if the problem goes away when doing so.
I've now had a look at your dB. I dont an error although when I move from one tab to another and back again the record goes into edit mode, which isnt so smart! So all I can suggest is that you try and NOT use the rich text control with a tab control!
Thanks for the points Casper. If I find a solution on my travels I'll post a comment. Something else I noticed though. You should NOT use a memo field as your primary key. In fact I would only use memo when really necessary!
Hi Terry i found a solution to the problem. I simply bound the controls at run time, so when you change the tab to one with a Rich text box control it gets bound to the memo field. A little like this Private Sub TabCtl0_Change() Dim tbc As Control, pge As Page ' Return reference to tab control. Set tbc = Me!TabCtl0 ' Return reference to currently selected page. Set pge = tbc.Pages(tbc.Value)
If pge.Name = "Page2" Then ActiveXCtl3.ControlSource = "RCT1" Else ActiveXCtl3.ControlSource = "" End If
End Sub
And i am not using a memo field for my primary key, only in the test db i send you.
thanks for that tip Casper, I'll try and keep it in mind if a similar questions pops up again.
og god weekend
Synes godt om
Ny brugerNybegynder
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.