Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rpjg
On your tepmplate try putting a commandbutton to show the Userform Charle -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Field button disappears? | Charts and Charting in Excel | |||
Command Button Disappears?? | Excel Discussion (Misc queries) | |||
Userform Initialize & combo box values | Excel Discussion (Misc queries) | |||
Second option button disappears when I make another column | Excel Worksheet Functions | |||
SaveCopyAs - Userform disappears | Excel Programming |