Dynamically setting a FORM Control Property to a new Value

  • Thread starter Giri Palakodeti
  • Start date
G

Giri Palakodeti

I have some code like this . Form name, control name , property value comes
from a Table and i have to set the value to a new value. How do i achieve
this in Access 2003?

'Forms![Co_Main]![Label88].Height = newvalue;

Eval("Forms!" & "[" & rs1("Form") & "]![" & Trim(rs1("actualControl")) &
"]." & Trim(rs1("ChangeProperty"))) = rs1("changeto_inches")
 
D

Dirk Goldgar

Giri Palakodeti said:
I have some code like this . Form name, control name , property value comes
from a Table and i have to set the value to a new value. How do i achieve
this in Access 2003?

'Forms![Co_Main]![Label88].Height = newvalue;

Eval("Forms!" & "[" & rs1("Form") & "]![" & Trim(rs1("actualControl")) &
"]." & Trim(rs1("ChangeProperty"))) = rs1("changeto_inches")


I'm not sure about setting a control's properties this way, but maybe
something like this:

Forms(rs1("Form")).Controls(rs1("actualControl")).Properties(rs1("ChangeProperty"))
= rs1("changeto_inches")
 
G

Giri Palakodeti

No luck. The suggestion is not working.

Dirk Goldgar said:
Giri Palakodeti said:
I have some code like this . Form name, control name , property value comes
from a Table and i have to set the value to a new value. How do i achieve
this in Access 2003?

'Forms![Co_Main]![Label88].Height = newvalue;

Eval("Forms!" & "[" & rs1("Form") & "]![" & Trim(rs1("actualControl")) &
"]." & Trim(rs1("ChangeProperty"))) = rs1("changeto_inches")


I'm not sure about setting a control's properties this way, but maybe
something like this:

Forms(rs1("Form")).Controls(rs1("actualControl")).Properties(rs1("ChangeProperty"))
= rs1("changeto_inches")


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Giri Palakodeti

I coded
DoCmd.Close acForm, rs1("Form"), acSaveYes

But some how this does not seem to be working.

Dirk Goldgar said:
Giri Palakodeti said:
I have some code like this . Form name, control name , property value comes
from a Table and i have to set the value to a new value. How do i achieve
this in Access 2003?

'Forms![Co_Main]![Label88].Height = newvalue;

Eval("Forms!" & "[" & rs1("Form") & "]![" & Trim(rs1("actualControl")) &
"]." & Trim(rs1("ChangeProperty"))) = rs1("changeto_inches")


I'm not sure about setting a control's properties this way, but maybe
something like this:

Forms(rs1("Form")).Controls(rs1("actualControl")).Properties(rs1("ChangeProperty"))
= rs1("changeto_inches")


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Giri Palakodeti

Thanks a lot . It worked. Actually I computed in Inches but need to keep it
in TWIPS

Dirk Goldgar said:
Giri Palakodeti said:
I have some code like this . Form name, control name , property value comes
from a Table and i have to set the value to a new value. How do i achieve
this in Access 2003?

'Forms![Co_Main]![Label88].Height = newvalue;

Eval("Forms!" & "[" & rs1("Form") & "]![" & Trim(rs1("actualControl")) &
"]." & Trim(rs1("ChangeProperty"))) = rs1("changeto_inches")


I'm not sure about setting a control's properties this way, but maybe
something like this:

Forms(rs1("Form")).Controls(rs1("actualControl")).Properties(rs1("ChangeProperty"))
= rs1("changeto_inches")


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top