|
-
Dec 9th, 2003, 01:20 PM
#1
Thread Starter
Frenzied Member
enable/focus in form_load
VB Code:
Combo0.Enabled = True
Combo13.Enabled = True
Combo0.RowSource = "01;02;03;04;05;06;07;08;09;10;11;12;"
Combo0.SetFocus
Combo0.Text = Format(Now, "mm")
Combo13.RowSource = Year(Now) - 1 & ";" & Year(Now) & ";" & Year(Now) + 1 & ";"
Combo13.SetFocus
Combo13.Text = Year(Now)
Display_Report.SetFocus
Combo0.Enabled = False
Combo13.Enabled = False
There has to be a better way to do this. I want the form to start up with values in the combo boxes but I don't want them to be enables unless the user clicks a different option button.
I had to do the setfocus enable/disable routine just to get it to work... unless there is a better way?!
-
Dec 9th, 2003, 01:51 PM
#2
Fanatic Member
...
dont use the .Text property of a combo box.
Code:
Combo0.Text = Format(Now, "mm")
becomes
Code:
Combo0 = Format(Now, "mm")
-
Dec 9th, 2003, 01:54 PM
#3
Thread Starter
Frenzied Member
Sweet... next question... I have 3 options in an option frame, but when I open the form and click on another option, it won't go to it. It will execute the code, but the option will not be selected.
??
-
Dec 9th, 2003, 01:57 PM
#4
Fanatic Member
also
get rid of the setfocus statements
-
Dec 9th, 2003, 01:58 PM
#5
Thread Starter
Frenzied Member
I did that. I had to do it that way to get it to work the first time.
-
Dec 9th, 2003, 01:59 PM
#6
Fanatic Member
check the value of the frame you attached the options buttons to
each option button should have its own value which is reflected in the Frame's value property
-
Dec 9th, 2003, 02:01 PM
#7
Fanatic Member
us the Wizard helps
the wizard helps a lot when setting up options groups
-
Dec 9th, 2003, 04:23 PM
#8
Frenzied Member
Omitting the default property (i.e. text) of a control when you reference it is also a little faster.
-
Dec 10th, 2003, 07:59 AM
#9
Thread Starter
Frenzied Member
OK, well I got the stupid thing figured out. I was setting the focus to the option to get around the problem of the error I posted before. As soon as I took all those out, it worked fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|