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

Dan Waters dwaters at usinternet.com
Mon Jun 23 07:09:40 CDT 2008


Hi Tom,

You didn't mention which report event you were using.  I've done this a ways
back and do remember that you need to be using a specific event - I think
it's either Format or Print.

HTH,
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tom Keatley
Sent: Monday, June 23, 2008 5:19 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Syntax for using table field values as controlnames and
values

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
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list