If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
evaluating controls on a report
i have some labels in my page header that i need to either clear or
populate within a loop. i get an error with eval("lblVDPV" & x).Caption = "whatever" or eval("lblVDPV" & x & ".Caption") = "whatever" says it can't find lblVDPV1, but of course it is there because lblVDPV1.Caption = "whatever" works fine. what am i missing? tia, mcnewsxp |
#2
|
|||
|
|||
evaluating controls on a report
Based on what you posted, I don't see a need for the EVAL function. I think
all you need is: Me.Controls("lblVDPV" & x).Caption -- Dave Hargis, Microsoft Access MVP "mcnews" wrote: i have some labels in my page header that i need to either clear or populate within a loop. i get an error with eval("lblVDPV" & x).Caption = "whatever" or eval("lblVDPV" & x & ".Caption") = "whatever" says it can't find lblVDPV1, but of course it is there because lblVDPV1.Caption = "whatever" works fine. what am i missing? tia, mcnewsxp |
#3
|
|||
|
|||
evaluating controls on a report
On Jul 29, 10:08*am, Klatuu wrote:
Based on what you posted, I don't see a need for the EVAL function. *I think all you need is: * * Me.Controls("lblVDPV" & x).Caption -- Dave Hargis, Microsoft Access MVP "mcnews" wrote: i have some labels in my page header that i need to either clear or populate within a loop. *i get an error with eval("lblVDPV" & x).Caption = "whatever" or eval("lblVDPV" & x & ".Caption") = "whatever" says it can't find lblVDPV1, but of course it is there because lblVDPV1.Caption = "whatever" works fine. what am i missing? tia, mcnewsxp wow - you're right! thanks. |
#4
|
|||
|
|||
evaluating controls on a report
If you were going to use Eval I think you would have to use something much
more complex. You would need to specify the Report and the control etc. I think the entire expression would be as follows. Eval("Reports(""NameOfReport"").lblVDPV" & x & ".Caption") = "WhatEver" John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County mcnewsxp wrote: On Jul 29, 10:08 am, Klatuu wrote: Based on what you posted, I don't see a need for the EVAL function. I think all you need is: Me.Controls("lblVDPV" & x).Caption -- Dave Hargis, Microsoft Access MVP "mcnews" wrote: i have some labels in my page header that i need to either clear or populate within a loop. i get an error with eval("lblVDPV" & x).Caption = "whatever" or eval("lblVDPV" & x & ".Caption") = "whatever" says it can't find lblVDPV1, but of course it is there because lblVDPV1.Caption = "whatever" works fine. what am i missing? tia, mcnewsxp wow - you're right! thanks. |
Thread Tools | |
Display Modes | |
|
|