Avatar billede william_munny Nybegynder
19. oktober 2003 - 12:27 Der 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.

Hvorfor de to fejlmeddelser ?
Avatar billede terry Ekspert
19. oktober 2003 - 13:07 #1
not sure why the error occur without first playing around with an example. But you could try placing the following line in the FORMS On Current event

On Error Resume Next
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:11 #2
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.
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:16 #3
Fejlen sker heller ikke når jeg åbner min form første gang, kun når jeg scroller mellem mine records
Avatar billede terry Ekspert
19. oktober 2003 - 13:21 #4
is it possible for youto send your dB to me so I can see waht is happening=
NOSPAMeksperten@santhell.dkNOSPAM

you need to remove NOSPAM
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:29 #5
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" ??
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:34 #6
Hvis jeg ikke bounder dem, opstår der ikke nogen fejl ??
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:38 #7
MSDN online siger
rtfSetNotPermitted 387 Property cannot be set.

Siger det dig noget ?
Avatar billede terry Ekspert
19. oktober 2003 - 13:48 #8
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!
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:52 #9
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
Avatar billede william_munny Nybegynder
19. oktober 2003 - 13:55 #10
Det samme er gældende på min test form.
Avatar billede terry Ekspert
19. oktober 2003 - 14:05 #11
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.
Avatar billede terry Ekspert
19. oktober 2003 - 14:06 #12
If there is NO code (test form) with four tabs do you still get the error?
Avatar billede william_munny Nybegynder
19. oktober 2003 - 14:14 #13
There are absolutly no code. I have send you a test db1.mdb with to forms one with tabs one without
Avatar billede terry Ekspert
19. oktober 2003 - 14:28 #14
I'll take a look
Avatar billede terry Ekspert
19. oktober 2003 - 14:30 #15
can you check waht you sent, I cant open it!
Avatar billede terry Ekspert
19. oktober 2003 - 14:32 #16
It was my Virus scanner which replaced it.
REname it to .txt or even better zip it
Avatar billede william_munny Nybegynder
19. oktober 2003 - 14:38 #17
I have zipped it and send it..
Avatar billede terry Ekspert
19. oktober 2003 - 14:41 #18
OK
Avatar billede terry Ekspert
19. oktober 2003 - 15:10 #19
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!
Avatar billede william_munny Nybegynder
19. oktober 2003 - 15:14 #20
Damn, I'll try a other way around it then. Not using tabs !!

But thx very much saved me from a lot of work.

/Casper

ps. The points are all yours
Avatar billede terry Ekspert
19. oktober 2003 - 17:14 #21
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!
Avatar billede william_munny Nybegynder
25. oktober 2003 - 15:30 #22
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.
Avatar billede terry Ekspert
25. oktober 2003 - 17:49 #23
thanks for that tip Casper, I'll try and keep it in mind if a similar questions pops up again.

og god weekend
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