|
-
Feb 25th, 2006, 11:07 PM
#1
Thread Starter
Fanatic Member
Form_Load Event issue
I have a form that has a lot of code in the Form_Load event. The problem is my form only shows after the code runs. How could I have the Form show at a certain stage in my code.
I tried the DoEvents command...
Is there even a way I can do this or do I need to setup something else?
-
Feb 25th, 2006, 11:19 PM
#2
Re: Form_Load Event issue
or and put that when you want it to show.
-
Feb 25th, 2006, 11:28 PM
#3
Re: Form_Load Event issue
 Originally Posted by Avatarp
I have a form that has a lot of code in the Form_Load event. The problem is my form only shows after the code runs. How could I have the Form show at a certain stage in my code.
I tried the DoEvents command...
Is there even a way I can do this or do I need to setup something else?
You can always..
VB Code:
Private Sub Form_Load()
Me.Show
'Your Form_Load code..
End Sub
-
Feb 25th, 2006, 11:35 PM
#4
Thread Starter
Fanatic Member
Re: Form_Load Event issue
i did that but none of my code runs
VB Code:
Private Sub Form_Load()
Dim Activation_Status_String As String
Me.Show 1
chkActive.Value = IIf(GetSetting("IntelliSchedule", "Weekend_Scheduling_Form_Controls", "ShowActiveEmps") = "", 1, GetSetting("IntelliSchedule", "Employees_Form_Controls", "ShowActiveEmps"))
chkShowLeave.Value = IIf(GetSetting("IntelliSchedule", "Weekend_Scheduling_Form_Controls", "ShowLeaveEmps") = "", 1, GetSetting("IntelliSchedule", "Employees_Form_Controls", "ShowLeaveEmps"))
chkShowInactive.Value = IIf(GetSetting("IntelliSchedule", "Weekend_Scheduling_Form_Controls", "ShowInactiveEmps") = "", 1, GetSetting("IntelliSchedule", "Employees_Form_Controls", "ShowInactiveEmps"))
DoEvents
DTPickerWeekend(0).Value = CDate("01/01/" & Year(Now))
DTPickerWeekend(1).Value = CDate("12/31/" & Year(Now))
Call Populate_Department_Combobox(comboboxTeamView)
comboboxTeamView.ListIndex = 0
' Activation_Status_String = Create_Activation_Status_String(chkActive, chkShowLeave, chkShowInactive)
' Call Populate_Employee_List(comboboxTeamView.Text, lstVwEmployees, Activation_Status_String)
Call Set_Employee_Weekend_Grid
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Auto Populate Employee Grid
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Call Populate_Employee_Weekend_Grid_Names(comboboxTeamView.Text)
Call Populate_Employee_Weekend_Grid_Days(comboboxTeamView.Text, DTPickerWeekend(0).Value, DTPickerWeekend(1).Value)
End Sub
-
Feb 25th, 2006, 11:39 PM
#5
Re: Form_Load Event issue
Maybe becuase you are showing it Modally, if you do it modally the code after show 1 won't be executed until the Form closes
-
Feb 25th, 2006, 11:40 PM
#6
Re: Form_Load Event issue
Use only
so it doesn't show as modal.
-
Feb 25th, 2006, 11:41 PM
#7
Thread Starter
Fanatic Member
Re: Form_Load Event issue
hmm so no way to do this if it is modal?
-
Feb 25th, 2006, 11:43 PM
#8
Re: Form_Load Event issue
If another form is opening it then use
-
Feb 25th, 2006, 11:44 PM
#9
Re: Form_Load Event issue
Yes, put that code in Form_Activate() event, so it will be executed after your Form is already visible.
And remove the Me.Show from there, use Form.Show 1 in the Form that call this one, as Andrew G said.
Last edited by jcis; Feb 25th, 2006 at 11:49 PM.
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
|