Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

When I run the userform initialize procedure to reset the values in tex
boxes and the like instead of resetting like it should, now it close
the userform completely and then won't allow me to show it again, wha
could be the problem?




Code
-------------------
Private Sub UserForm_Initialize()
Me.MultiPage1.Value = 0
TextBox3.Value = ActiveWorkbook.Sheets("Sales Invoice").Range("G15").Value
Dim hWndForm As Long
Dim hMenu As Long
hWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000
hMenu = GetSystemMenu(hWndForm, 0)
DeleteMenu hMenu, SC_CLOSE, 0&
End Sub

-------------------





The Dim stuff down is to gray out the x button, there are also som
module level declarations to go with that...



Code
-------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const SC_CLOSE As Long = &HF060

-------------------





Can anyone help me out, I thought I had solved a real big problem onl
to get this, the userform shows when the workbook opens and is the
hidden when the user has finished entering values, then when the use
goes through the process of being asked to print and save, they ar
then asked if they would like to create a new record, if yes then i
shows the userform again, but the userform is still filled with all th
stuff previously entered. I tried using the unload me instead of hidin
and that wouldn't work at all, didn't give errors just didn't show th
userform either, this at least shows the userform, but now when th
user goes to clear the information by initializing the userform again
it simply closes the userform and then it can't be shown again either
Please help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

RPIJG

You need to set the values of the textbox to blanks.

textbox1.value = ""

Also you need to set the checkbox or optionbottons to false

userform1.optionbutton1 = False
userform1.checkbox1 = False


This should clear the previous input.

HTH

Charle

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

Hi Charles, The values for the textboxes are set that way (I shortene
the code considerably because there was alot of it) but the textboxe
get their values from the Worksheet as I showed above, but when th
code runs the spaces are empty so the textboxes should be empty.
However, this would only be so if I could get the userform t
initialize, but when I do that, it disappears and then I am not able t
show it again unless I close the template and reopen it. Why would
userform initialize cause the userform to be unload or hidden so tha
it couldn't be shown

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

Rpjg

On your tepmplate try putting a commandbutton to show the Userform


Charle

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

Charles I tried it...still nothing, the userform doesn't show, but
don't have any errors, it simply doesn't show

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

RPIJG

If you want send me your workbook and I'll look at it. However I canno
look at it today. Other things I have to do right now.


Charle

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

Sure Charles I'll send you an email with this...as well as some othe
instructions (mainly because it will fault without a few folder name
and what not). I truly appreciate this, you so far are the only perso
who has been willing to take a look at this at all. Thanks

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

my file is too big to be attached here, I thought I'd attach it but i
won't, so I've gone ahead and put it up here, hopefully you ca
download it from here...a few things to mention, all the files an
folders in the .zip need to be put into a folder called SyntheticShiel
in the C:\ drive so that you have C:\SyntheticShield as the prior, tha
way you get C:\SyntheticShield\Quotes as a folder location as well a
some other references (ie saving etc.) The template I'm havin
problems with is the SyntheticShieldInvoiceMaker template, th
QuoteMaker template works without a problem. Anyone with any comment
or criticisms feel free, I started out doing this as a major rookie
and slowly made things way more complicated for me (hopefully easie
for the user). Thanks Charles for you help, and anyone else tha
chooses to chime in :)

http://home.ripway.com/2004-1/53847/InvoiceMaker.zi

--
Message posted from http://www.ExcelForum.com

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform disappears when you try to initialize from a command button

anybody else to help, by the way whats with the hack thing

--
Message posted from http://www.ExcelForum.com

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
Data Field button disappears? Rich Charts and Charting in Excel 1 September 13th 07 05:38 PM
Command Button Disappears?? TrevorC Excel Discussion (Misc queries) 4 July 19th 06 06:17 PM
Userform Initialize & combo box values michaelberrier Excel Discussion (Misc queries) 3 June 27th 06 04:35 PM
Second option button disappears when I make another column Monique Excel Worksheet Functions 0 March 9th 05 09:57 PM
SaveCopyAs - Userform disappears mohsinb[_2_] Excel Programming 1 November 6th 03 04:02 PM


All times are GMT +1. The time now is 01:56 PM.

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"