[AccessD] Syntax for using table field values as controlnames and values

Tom Keatley tom.p at piedpiper.com.au
Mon Jun 23 05:19:28 CDT 2008


Hi all ......

I am saving report control placement values (control name, left, top, width, height) in a table and then want to retrieve those values for use back in the report. 

This will allow me to quickly set up reports with different placement of controls on the fly. 

I am not having any trouble saving the parameters but I think I am having syntax problems when trying to use the values back in the report 


The syntax usually for setting say the distance from left for a control would be ControlName.left = 1440 (that is if you were to type it in code). 

But if you were to use BOTH the control name and its value from two table fields what would the syntax be ....I have tried quite a few variations but am yet to get one to work successfully .... My recordset IS returning the correct string values and the code is running without errors (depending of course on my syntax)


A bit of the code I am using is below.......
Of course the particular string I am building there for VarCtl DOES NOT work it is just one of the variations I have tried ...  

ParamRs.MoveFirst

While Not ParamRs.EOF

Select Case ParamRs!ctlname

Case "aStoregraph" 'Image Ctrl

Dim VarCtl As String
VarCtl = "[" & ParamRs!ctlname & "]" & ".[left]"

VarCtl = ParamRs!CtlLeft

Case Else
End Select

ParamRs.movenext
wend

Any assistance would be valued 

Thank You

Tom Keatley


More information about the AccessD mailing list