LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default UserForm

I use a user form in which the user shall enter a date in a text field. I
then have a sub that checks if the date is valid. If not so I show a message
box. However I want the program to show the message box and when the user
clicks OK I want the user form to still be shown.

Private Sub checkDate()
If (Not (IsDate(userForm1.TextBox1.Text))) Then
MsgBox ("Date not valid")
End If
If (Not (IsDate(userForm1.TextBox2.Text))) Then
MsgBox ("Date not valid")
Else: Call mainProgram
End If
End Sub

The problem is that I do not know how to write a sub that just shows the
user form.
Now I just have a sub that gives instructions when the user clicks a button
on the user form. This sub calls checkDate as you can see below.

Private Sub genereraRapportKnapp_Click()
Call checkDate
Call mainProgram
Unload Me
End Sub

The user form is created in a Modul when pressing a button.

Public Sub startKnapp_Click()
userForm1.Show
End Sub

If anyone has a clue how to solve this please help me, I seem to be quite
lost....Thank you.
 
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
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
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


All times are GMT +1. The time now is 04:23 PM.

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

About Us

"It's about Microsoft Excel"