Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default UserForm will not appear

Here is my code:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

That's it. But every time I click on CommandButton1, I get this error:
"Application-define or object-defined error". The user form worked up until
today and I can't think of anything I've done to affect it. Can anyone help
me fix this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default UserForm will not appear

I can't seem to recreate the error.

Do you have any code in the Userform1 Intialize Event? If so, post the code
in that event so we can try to fix the bug.
--
Cheers,
Ryan


"Luke" wrote:

Here is my code:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

That's it. But every time I click on CommandButton1, I get this error:
"Application-define or object-defined error". The user form worked up until
today and I can't think of anything I've done to affect it. Can anyone help
me fix this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default UserForm will not appear

Sure. Here's the code from the initialize event:

Private Sub UserForm_Initialize()

' Filling the State and Weekday list boxes
With ComboBox6
.AddItem "Alabama"
.AddItem "Alaska"
.AddItem "Arizona"
.AddItem "Arkansas"
.AddItem "California"
.AddItem "Colorado"
.AddItem "Connecticut"
.AddItem "DC"
.AddItem "Delaware"
.AddItem "Florida"
.AddItem "Georgia"
.AddItem "Hawaii"
.AddItem "Idaho"
.AddItem "Illinois"
.AddItem "Indiana"
.AddItem "Iowa"
.AddItem "Kansas"
.AddItem "Kentucky"
.AddItem "Louisiana"
.AddItem "Maine"
.AddItem "Maryland"
.AddItem "Massachusetts"
.AddItem "Michigan"
.AddItem "Minnesota"
.AddItem "Mississippi"
.AddItem "Missouri"
.AddItem "Montana"
.AddItem "Nebraska"
.AddItem "Nevada"
.AddItem "New Hampshire"
.AddItem "New Jersey"
.AddItem "New Mexico"
.AddItem "New York"
.AddItem "North Carolina"
.AddItem "North Dakota"
.AddItem "Ohio"
.AddItem "Oklahoma"
.AddItem "Oregon"
.AddItem "Pennsylvania"
.AddItem "Rhode Island"
.AddItem "South Carolina"
.AddItem "South Dakota"
.AddItem "Tennessee"
.AddItem "Texas"
.AddItem "Utah"
.AddItem "Vermont"
.AddItem "Virginia"
.AddItem "Washington"
.AddItem "West Virginia"
.AddItem "Wisconsin"
.AddItem "Wyoming"
End With
With ComboBox7
.AddItem "Sunday"
.AddItem "Monday"
.AddItem "Tuesday"
.AddItem "Wednesday"
.AddItem "Thursday"
.AddItem "Friday"
.AddItem "Saturday"
End With
' Selecting the first items in each list
ComboBox6.ListIndex = 0
ComboBox7.ListIndex = 0
' Setting MaxDate and MinDate
DTPicker2.MaxDate = Worksheets("Claims").Range("A1").Value
DTPicker2.MinDate = "1/1/2004"
DTPicker1.MaxDate = Worksheets("Claims").Range("A1").Value
DTPicker1.MinDate = "1/1/2004"
DTPicker1.Value = Worksheets("Claims").Range("B1").Value
DTPicker2.Value = Worksheets("Claims").Range("A1").Value
' Pre-selecting client type
UserForm1.OptionButton1.Value = False
UserForm1.OptionButton2.Value = False
UserForm1.OptionButton3.Value = True
UserForm1.OptionButton4.Value = False
With ComboBox9
.AddItem "Open Claims"
.AddItem "Closed Claims"
End With
ComboBox9.ListIndex = 0
With ComboBox1
.RowSource = Worksheets("Claims").Range("D3:D" & _
Worksheets("Claims").Range("C1").Value)
End With
End Sub

Not the fanciest bit of code, but it was doing what I needed until just
recently.

"Ryan H" wrote:

I can't seem to recreate the error.

Do you have any code in the Userform1 Intialize Event? If so, post the code
in that event so we can try to fix the bug.
--
Cheers,
Ryan


"Luke" wrote:

Here is my code:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

That's it. But every time I click on CommandButton1, I get this error:
"Application-define or object-defined error". The user form worked up until
today and I can't think of anything I've done to affect it. Can anyone help
me fix this?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default UserForm will not appear

Nevermind. I changed the ComboBox1 part (where I tried to set the RowSource)
to a small For-Next loop and added each item I wanted. I also cleared out
the RowSource value that was showing in the ComboBox1 properties. All
appears to work now as it should.

Sorry for taking up your time. Thank you for being willing to help.

"Luke" wrote:

Sure. Here's the code from the initialize event:

Private Sub UserForm_Initialize()

' Filling the State and Weekday list boxes
With ComboBox6
.AddItem "Alabama"
.AddItem "Alaska"
.AddItem "Arizona"
.AddItem "Arkansas"
.AddItem "California"
.AddItem "Colorado"
.AddItem "Connecticut"
.AddItem "DC"
.AddItem "Delaware"
.AddItem "Florida"
.AddItem "Georgia"
.AddItem "Hawaii"
.AddItem "Idaho"
.AddItem "Illinois"
.AddItem "Indiana"
.AddItem "Iowa"
.AddItem "Kansas"
.AddItem "Kentucky"
.AddItem "Louisiana"
.AddItem "Maine"
.AddItem "Maryland"
.AddItem "Massachusetts"
.AddItem "Michigan"
.AddItem "Minnesota"
.AddItem "Mississippi"
.AddItem "Missouri"
.AddItem "Montana"
.AddItem "Nebraska"
.AddItem "Nevada"
.AddItem "New Hampshire"
.AddItem "New Jersey"
.AddItem "New Mexico"
.AddItem "New York"
.AddItem "North Carolina"
.AddItem "North Dakota"
.AddItem "Ohio"
.AddItem "Oklahoma"
.AddItem "Oregon"
.AddItem "Pennsylvania"
.AddItem "Rhode Island"
.AddItem "South Carolina"
.AddItem "South Dakota"
.AddItem "Tennessee"
.AddItem "Texas"
.AddItem "Utah"
.AddItem "Vermont"
.AddItem "Virginia"
.AddItem "Washington"
.AddItem "West Virginia"
.AddItem "Wisconsin"
.AddItem "Wyoming"
End With
With ComboBox7
.AddItem "Sunday"
.AddItem "Monday"
.AddItem "Tuesday"
.AddItem "Wednesday"
.AddItem "Thursday"
.AddItem "Friday"
.AddItem "Saturday"
End With
' Selecting the first items in each list
ComboBox6.ListIndex = 0
ComboBox7.ListIndex = 0
' Setting MaxDate and MinDate
DTPicker2.MaxDate = Worksheets("Claims").Range("A1").Value
DTPicker2.MinDate = "1/1/2004"
DTPicker1.MaxDate = Worksheets("Claims").Range("A1").Value
DTPicker1.MinDate = "1/1/2004"
DTPicker1.Value = Worksheets("Claims").Range("B1").Value
DTPicker2.Value = Worksheets("Claims").Range("A1").Value
' Pre-selecting client type
UserForm1.OptionButton1.Value = False
UserForm1.OptionButton2.Value = False
UserForm1.OptionButton3.Value = True
UserForm1.OptionButton4.Value = False
With ComboBox9
.AddItem "Open Claims"
.AddItem "Closed Claims"
End With
ComboBox9.ListIndex = 0
With ComboBox1
.RowSource = Worksheets("Claims").Range("D3:D" & _
Worksheets("Claims").Range("C1").Value)
End With
End Sub

Not the fanciest bit of code, but it was doing what I needed until just
recently.

"Ryan H" wrote:

I can't seem to recreate the error.

Do you have any code in the Userform1 Intialize Event? If so, post the code
in that event so we can try to fix the bug.
--
Cheers,
Ryan


"Luke" wrote:

Here is my code:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

That's it. But every time I click on CommandButton1, I get this error:
"Application-define or object-defined error". The user form worked up until
today and I can't think of anything I've done to affect it. Can anyone help
me fix this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill userform textbox from userform listbox clik event GregJG[_21_] Excel Programming 3 December 7th 08 04:47 PM
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM


All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"