By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,870 Members | 2,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,870 IT Pros & Developers. It's quick & easy.

changing controls specialeffect at runtime

100+
P: 553
Hi

I used this code to change the special effect of the controls.
After this, the form is saved.

Expand|Select|Wrap|Line Numbers
  1.     Dim ctl As Control
  2.  
  3.     For Each ctl In Me.Controls
  4.         If TypeOf ctl Is ComboBox Then
  5.            ctl.SpecialEffect = 0
  6.            ctl.BorderColor = RGB(255, 128, 140)
  7.         End If
  8.      Next ctl
  9.  
  10.      DoCmd.Save acForm, "Form1"
  11.  

When i close the form and re-open it ,all the changes are not there.

Why does it do that when i save the form as well from code itself ?

Thanks
Qi
Oct 12 '07 #1
Share this Question
Share on Google+
4 Replies


nico5038
Expert 2.5K+
P: 3,072
Change

DoCmd.Save acForm, "Form1"

into

DoCmd.Close acForm, "Form1", acSaveYes

And tell me the result. Make sure that the form is open in edit mode when running the code !

Nic;o)
Oct 12 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
The DoCmd.Close acForm, "Form1", acSaveYes

part is correct, but I think the changes have to be made while the form is in Design View, not while the it's being used in the normal fashion.

Linq ;0)>
Oct 12 '07 #3

nico5038
Expert 2.5K+
P: 3,072
Well detected hawkeye Linq. Should have used "Design View" instead of "edit mode" <LOL>

Nic;o)
Oct 12 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
I figured that was what you meant!

;0)>

BTW, did you once upon a time belong to those mercenary guys over at Experts-Exchange (knowledge for money)?
Oct 12 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.