Solved TransformedRowSource-error (1 Viewer)

so10070

Registered User.
Local time
Today, 07:26
Joined
Aug 18, 2016
Messages
51
Got the following error : "cannot map to a read-only property". I don't understand this error. :(
This is the code which I use:

Code:
Private Sub Form_Load()
    Dim sqlBron As String
    Dim sqlTransform As String

    sqlBron = "SELECT tblPatientenLijst.PTN_ID, tblPatientenLijst.PTN_Naam, tblPatientenLijst.PTN_Voornaam, tblKenmerk.K_Naam, " & _
        "tblBloedAnalyse.BLA_Datum, Format(Format([BLA_Datum],""ddmmyyyy""),""00\/00\/0000"") AS Datum, tblWaarden.W_Waarde, tblMinMaxeenheid.MME_Min, tblMinMaxeenheid.MME_Max " & _
        "FROM tblPatientenLijst INNER JOIN ((tblBloedAnalyse INNER JOIN (tblKenmerk INNER JOIN tblWaarden ON tblKenmerk.K_iD = tblWaarden.K_ID) ON " & _
        "tblBloedAnalyse.BLA_ID = tblWaarden.BLA_ID) INNER JOIN tblMinMaxeenheid ON tblKenmerk.K_iD = tblMinMaxeenheid.K_ID) ON tblPatientenLijst.PTN_ID = tblBloedAnalyse.PTN_ID " & _
        "WHERE (((tblPatientenLijst.PTN_ID) = " & TempVars.Item("Patient_ID") & ") And ((tblWaarden.K_ID) = " & TempVars.Item("BloedKenmerk") & ")) " & _
        "ORDER BY tblBloedAnalyse.BLA_Datum;"

    sqlTransform = "SELECT qryBloedkenmerken.[Datum], qryBloedkenmerken.[W_Waarde], qryBloedkenmerken.[MME_Min], qryBloedkenmerken.[MME_Max] " & _
        "FROM qryBloedkenmerken;"

    With Me
        .txtPatientNaam = TempVars.Item("Patien_Naam") & " " & TempVars.Item("Patent_Voornaam")
        .txtPatientNaam.BackStyle = 0
        .txtPatientNaam.BorderStyle = 0
        .txtPatientNaam.Locked = True
        .txtPatientNaam.Enabled = False
        
        With .grfBloedKenmerk
            .HasTitle = True
            .ChartTitle = TempVars.Item("GrafiekTitel")
            .RowSource = sqlBron
            .TransformedRowSource = sqlTransform <<<<<<<<<<<<<<<<<<<<<<<<<<
        End With
    End With
End Sub
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:26
Joined
Feb 19, 2013
Messages
16,612
error is saying you cannot change the property

what type of control is grfBloedKenmerk? I assumed a graph control - but that does not have a .TransformedRowSource so far as I can see. And the rowsource should be a crosstab query - which sqlBron isn't.
 

so10070

Registered User.
Local time
Today, 07:26
Joined
Aug 18, 2016
Messages
51
Yes, grfBloedkenmerk is a graph control (rowsource). But by creating the graph through Chart Settings, there is no need to use a crosstab query to get a .TransformRowSource query. That I don't understand. See image (sorry it's in Flemish). My question is: how can I write this out in a procedure? As you can see here is a .TransformRowSource query.

characteristics.png
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:26
Joined
Feb 19, 2013
Messages
16,612
Regret I don't think I can help - sounds like you are using 'modern charts' rather than the 'classic charts' I use.

You need someone who has experience of modern charts. Not sure who to suggest but maybe @isladogs is better placed to make a suggestion
 

so10070

Registered User.
Local time
Today, 07:26
Joined
Aug 18, 2016
Messages
51
Problem solved: I control the graph via a query (in vba) and the transformed query is then generated automatically. And ofcours the transformed query isn't editable through vba. It is read only! :)
 

Users who are viewing this thread

Top Bottom