B
Bishop
I have created a dialog box (NotSoFast) to pop up when my workbook is opened.
The dialog box has 4 comboboxes (Name, Center, Month, Week) each of which
I've created data for, and a button (Panic Switch) which captures the data.
My dialog box shows when the workbook is opened but there's no data in any of
my combobox lists. What is causing this? Below is my code:
Auto_open code
Private Sub Workbook_Open()
NotSoFast.Show
End Sub
---------------------------------------------------------
command button code
Private Sub PanicSwitch_Click()
MonthSelect = Month.Value
WeekSelect = Week.Value
NameSelect = Name.Value
CenterSelect = Center.Value
Cells(1, 1) = MonthSelect
Cells(2, 1) = WeekSelect
Cells(1, 2) = NameSelect
Cells(2, 2) = CenterSelect
Unload NotSoFast
End Sub
---------------------------------------------------------
module code for the comboboxes
Public NameSelect As String
Public CenterSelect As String
Public MonthSelect As String
Public WeekSelect As String
Sub ShowNotSoFast()
With NotSoFast.Name
.RowSource = ""
.AddItem "Bishop Minter"
.AddItem "Carlos Trespalacios"
.AddItem "Dennis Murphy"
.AddItem "Gary Hayden"
.AddItem "Gloria Montoya"
.AddItem "Lisa Muttillo"
.AddItem "Lorraine Warburton"
.AddItem "Warner Langlois"
End With
With NotSoFast.Center
.RowSource = ""
.AddItem "Bothell"
.AddItem "Collinsville"
.AddItem "El Paso"
.AddItem "Evansville"
.AddItem "Greensboro"
.AddItem "Heathrow"
.AddItem "Joplin"
.AddItem "Kennesaw"
.AddItem "Lafayette"
.AddItem "Manhattan"
.AddItem "Mansfield"
.AddItem "Sioux City"
.AddItem "Ottawa"
.AddItem "Ponco City"
.AddItem "Terra Haute"
End With
With NotSoFast.Month
.RowSource = ""
.AddItem "January"
.AddItem "February"
.AddItem "March"
.AddItem "April"
.AddItem "May"
.AddItem "June"
.AddItem "July"
.AddItem "August"
.AddItem "September"
.AddItem "October"
.AddItem "November"
.AddItem "December"
End With
With NotSoFast.Week
.RowSource = ""
.AddItem "Week 1"
.AddItem "Week 2"
.AddItem "Week 3"
.AddItem "Week 4"
.AddItem "Week 5"
End With
NotSoFast.Show
End Sub
---------------------------------------------------------
Also, the code will not compile unless I comment out anything pertaining to
Name. I get a "Compile Error: With object must be user-defined type, Object
or Variant" with the first With statement under Sub ShowNotSoFast(). If I
comment out that entire With Block I get a "Compile Error: Invalid Qualifier"
for Name in the NameSelect = Name.Value line under Private Sub
PanicSwitch_Click(). If I comment out both of those the code compiles. I've
retyped Name in Properties for the combobox and that didn't fix it. What's
the problem?
The dialog box has 4 comboboxes (Name, Center, Month, Week) each of which
I've created data for, and a button (Panic Switch) which captures the data.
My dialog box shows when the workbook is opened but there's no data in any of
my combobox lists. What is causing this? Below is my code:
Auto_open code
Private Sub Workbook_Open()
NotSoFast.Show
End Sub
---------------------------------------------------------
command button code
Private Sub PanicSwitch_Click()
MonthSelect = Month.Value
WeekSelect = Week.Value
NameSelect = Name.Value
CenterSelect = Center.Value
Cells(1, 1) = MonthSelect
Cells(2, 1) = WeekSelect
Cells(1, 2) = NameSelect
Cells(2, 2) = CenterSelect
Unload NotSoFast
End Sub
---------------------------------------------------------
module code for the comboboxes
Public NameSelect As String
Public CenterSelect As String
Public MonthSelect As String
Public WeekSelect As String
Sub ShowNotSoFast()
With NotSoFast.Name
.RowSource = ""
.AddItem "Bishop Minter"
.AddItem "Carlos Trespalacios"
.AddItem "Dennis Murphy"
.AddItem "Gary Hayden"
.AddItem "Gloria Montoya"
.AddItem "Lisa Muttillo"
.AddItem "Lorraine Warburton"
.AddItem "Warner Langlois"
End With
With NotSoFast.Center
.RowSource = ""
.AddItem "Bothell"
.AddItem "Collinsville"
.AddItem "El Paso"
.AddItem "Evansville"
.AddItem "Greensboro"
.AddItem "Heathrow"
.AddItem "Joplin"
.AddItem "Kennesaw"
.AddItem "Lafayette"
.AddItem "Manhattan"
.AddItem "Mansfield"
.AddItem "Sioux City"
.AddItem "Ottawa"
.AddItem "Ponco City"
.AddItem "Terra Haute"
End With
With NotSoFast.Month
.RowSource = ""
.AddItem "January"
.AddItem "February"
.AddItem "March"
.AddItem "April"
.AddItem "May"
.AddItem "June"
.AddItem "July"
.AddItem "August"
.AddItem "September"
.AddItem "October"
.AddItem "November"
.AddItem "December"
End With
With NotSoFast.Week
.RowSource = ""
.AddItem "Week 1"
.AddItem "Week 2"
.AddItem "Week 3"
.AddItem "Week 4"
.AddItem "Week 5"
End With
NotSoFast.Show
End Sub
---------------------------------------------------------
Also, the code will not compile unless I comment out anything pertaining to
Name. I get a "Compile Error: With object must be user-defined type, Object
or Variant" with the first With statement under Sub ShowNotSoFast(). If I
comment out that entire With Block I get a "Compile Error: Invalid Qualifier"
for Name in the NameSelect = Name.Value line under Private Sub
PanicSwitch_Click(). If I comment out both of those the code compiles. I've
retyped Name in Properties for the combobox and that didn't fix it. What's
the problem?