Userform Query_Close() question

Does anybody know where I can find a good
reference to the userform Query_Close() function???

I would like more information on how to use the
"Cancel" and "CloseMode" parameters.

thank you


0
Robert
12/26/2009 9:44:32 AM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
972 Views

Similar Articles

[PageSpeed] 22

It's pretty simple.

Click the red X top right, a common way to close windows, and it's CloseMode 
0.
Close the form by code (like Unload Me from a button) and it's CloseMode 1.

Cancel is set to stop the close operation. If a checkbox1 says "I accept the 
license agreement" then this code keeps the form open until the box is 
checked:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If Me.CheckBox1.Value = False Then
    Cancel = True
    MsgBox "You must agree with us first"
End If
End Sub

Or if you simply want to disable the red X:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub

HTH. Best wishes Harald



"Robert Crandal" <nobody@gmail.com> wrote in message 
news:5WkZm.2809$pA1.865@newsfe17.iad...
> Does anybody know where I can find a good
> reference to the userform Query_Close() function???
>
> I would like more information on how to use the
> "Cancel" and "CloseMode" parameters.
>
> thank you
>
> 

0
Harald
12/26/2009 10:09:29 AM
Reply:

Similar Artilces:

Data Validation Question #9
I have a list of equipment that is Type,Make,Model, Height,weight,Lenth,Depth etc What I would like to do is have combo boxes (3) starting with Type - you pick the type you want the in the next combo it filters the list so just the Makes with that type available are in that combo - pick your make and the third combo is just the model numbers of the type and make I can then use vlookup to add in the height etc The big list is on a different worksheet any easy ways to do this without VB or guidance on the VB way if that is the only way would be great You can create dependent data validati...

A question posed to me...need answer
Greetings, I was posed a question the other day of which the answer I am not quite sure. Is there a way to take information from an Adobe PDF file and export it to an Excel spreadsheet? If you have any idea of how it can be done, I would appreciate the reply. -- Thank you for your time and attention to this matter, Robert Wisian Jr. rwisianjr@austin.rr.com 512-589-2805 Hi Robert problem is that a PDF file is intended to be the 'end stage' of a document. So it's not designed to extract/export the text within. there are some solutions available (try searching google for ...

Stored Procedure BIT type Optional Parameter Question
I am creating a stored procedure that will have a BIT type parameter that will be optional. If that parameter is not included then it should return all values (1 and 0). I've put together the SP below but I am wondering if there is a cleaner way to handle this situation. CREATE PROCEDURE [dbo].[GetItems] @IsInsert Bit = NULL, @ItemYear Int = NULL AS BEGIN SET NOCOUNT ON; SELECT * FROM Item WHERE ItemYear = COALESCE(@ItemYear, '%') AND (IsInsert = COALESCE(@IsInsert, 1) OR IsInsert = COALESCE(@IsInsert, 0)) END From performance stand point it will be...

Programming question
I have a VB enabled Excel document. One tab has a value in Column B. If that value is "A" or "B", I want to create a row somewhere that contains the lowest value of the corresponding columns C, D, E, F, G, H, I, J, K, M, N, O, P, Q, R, S, T, U This tab is growing. Could someone assist me in creating this row? -- "In no part of the constitution is more wisdom to be found, than in the clause which confides the question of war or peace to the legislature, and not to the executive department." - James Madison Hi Howard No need for a m...

Follow up to Calculated Field question .....
The syntax worked fine for that. Now I'm wondering two more things ... In one of the tables I have multiple identical room numbers that I need to combine in this calculated field to determine a price for each room. Plus, I also need to determine a number for income generated based upon the number of days the romm is rented. Can you point me in the right direction? Thanks ...

Upgrade question M04 to MO7
Hello, I am considering upgrading from MO4 to MO7 and am wondering how much integration there is in MO7 with MSN Money. I do not wish to have anything to do with MSN Money, and especially do not want my financial data on MSN servers. Is it possible to use MO7 without any exposure to MSN Money? Can I download transaction info from my financial institutions without it ending up on MSN servers? TIA, Mike W. The test of every religious, political, or educational system is the man that it forms. -Henri-Fr�d�ric Amiel Our knowledge is a little island in a great ocean of nonknowledge. I...

Stupid (I hope) XML questions
Ok, I have a project that is destined for continual growth and development over the next few years (benign scope creep). The object model is relatively generic at the moment, but will be extended considerably over time, mostly using inheritance. Each document will have a single element at the root and it will contain a collection of objects that are based off of a finite number of base classes. However, these objects may have numerous child classes and I can not guarantee that the child classes won't be containers themselves. References will be allowed between objects of different base typ...

corrupt database question
I have Access 2003. When I open the db, there are forms, queries, and reports missing. When I go into one of the forms that is available, the data is not accurate. For instance, I had ~ 200 files listed in a table, and only 17 showed up. Any ideas? Thanks!-- Nola Nola wrote:> I have Access 2003. When I open the db, there are forms, queries, and> reports missing. When I go into one of the forms that is available,> the data is not accurate. For instance, I had ~ 200 files listed in a> table, and only 17 showed up. Any ideas? Thanks! Somebody else may have a better idea, but I sugg...

Pivot Question Urgent!!
hi I have two columns Ins.Contractor Int.Contractor A B A C B C C A A A D X I want display the count of both the contractors grouped by Contractor name Contractor Count of Ins. count of Int. A 3 2 B 1 1 C 1 2 D 1 0 X ...

Formula Question? #2
Hello All, I am cuurently using this expression to count "Job" in an array. =COUNTIF(Database!K4:K15000,"Job") What I am looking for is a way to find this in a string of possible answers This answer may have "Job" ,but not the first in a line of possible answer ex: "Gui Job Run Exp" / "Run Exp Gui Job"/ etc... I've tried using "*" to find any "Job" in the array, but I thnk that the formula is looking at the first part of the answer only. Is there any other way of doing this without typing every possbile comb with &q...

Another Query Question
Hi all With the help of Ken Sheridan, I feel in touching distance of a solution to my current application issues. I have a union query which returns results on links made between accounts. Each entry represents a defined link between 2 accounts - there is a remarks column (not shown) associated to the link describing the reason behind it. There are 2 fields in the union query: link-id and ac-id. So the output of the union query looks like: link-id ac-id 1 1647 2 1639 3 1681 4 1677 5 1681 1 1677 2 ...

Attn Frank Kabel
Frank, You've always been able to assist me in the past.... do you care to take a crack at this one? I have a list that contains about 45 different employee names. Many of the names are listed more than once and the number of names on the list is constantly changing. I'd like to know if there is a formula that will allow me to count the total number of names with each name being counted only once? Example: John Bill John Mary Joan Bill Leroy I want to know how many employees are in the list, not counting the duplicates. In the example above the count would be 5. Hope that...

Beginner questions about creating a sheet.
Hi all, I am having trouble learning some basic functions. So far all I can do is simple calculations. I have made a tip calculator, and growth preidictor for recruitment numbers. Howerver where can I go to get basic step by step training? I just want to create a simple sheet that contains a stage that a sale is in like (1st, 2nd, 3rd etc), the sale name and the name of the person who is buying or being cultivated. I would also like to create a sheet that has check marks that are not in the form tools. I see how I can insert those, but I also downloaded a template and it has check marks wit...

Yet another userform combobox question
Hi Can anyone tell me how, when I select an option in a drop down menu in a userform combobox, I can code it to shrink back down again once the selection is made. At the moment it just hangs there like a lemon until I click on it again wow, you're just posting this all over the place. ever wonder why no one is answering your post. very impolite. "teepee" wrote: > Hi > > Can anyone tell me how, when I select an option in a drop down menu in a > userform combobox, I can code it to shrink back down again once the > selection is made. > > At the momen...

Outlook 2007 Reading Pane
Hi. I was wondering if there is a way to stop Outlook 2007 from automatically opening e-mails? I like the Reading Pane, but I don't want it to automatically open a new e-mail message (or automatically show my old e-mail message). For example, it would be nice to highlight which new e-mail I want shown to me, or click spacebar, etc. instead of it automatically opening them, because when Outlook 2007 is downloading my e-mail AND trying to show me an e-mail at the same time, Outlook sort-of freezes until it finishes downloading my new e-mail. Thanks in advance! The reading pane i...

Question about XML functionality (add-ons?) in Excel 2000 & 2002
We have recently been told by our agency systems administrator that we need to upgrade all of our existing PCs so they have Office 2003 because of an XML function that allows us to import/export data to and from our agency server. Obviously, this would not only be prohibitively expensive, but time-consuming as well. What I would like to know is if there is some kind of XML add-on that we can install for Excel 2000 and/or XP that will give us the same XML functionality as Excel 2003? Thanks MUCH in advance if anyone can give me an answer on this. ...

crash with text field in VB userform
I've got a set of VB macros for MS Word 2004 that use text fields in VB userforms. Up until recently this was fine, but either due to a Tiger update or a Word 2004 update, now if the user types into the text field, Word immediately crashes. This occurs in several different userforms. I'm running Mac OS 10.4.11, Word 2004 11.3.5. I'm on a Mac Mini but I've seen the same behavior on a G5. Has anyone else seen this? Got suggestions? I haven't seen this. I do know that the Graphics Update Apple pushed out to OS 10.4.9 PPC systems broke a bunch of stuff. Sorry to be no help....

Outlook 200, outlook today question
I'm using OL 2000 w/ Win xp, all updates. I just replaced my old crt with a flat screen HD monitor. A problem came up with outlook today. On the calendar, when an item goes past due time, it goes gray. On the old crt it was still readable, on the new flat screen it's not - it's too faint. I can't find anyway of adjusting the past time calendar items to be darker either on the monitor or in OL. Any ideas? Thanks That's controlled by embedded CSS and can't be changed easily. Which style do you use? I thought the default Outlook Today style makes it look a tin...

Switchboard Question 01-04-10
Hi, I posted this question a couple of weeks ago and have not had any responses. Does anyone know if it is possible to get a hyperlink hand (or something similar) in a switchboard, to click on the list? It is very frustating that there is no option for this to occur. Thanks "kenista" <kenista@discussions.microsoft.com> wrote in message news:3656F81E-35DB-4061-ACD6-3BA085994721@microsoft.com... | Hi, | | I posted this question a couple of weeks ago and have not had any responses. | | Does anyone know if it is possible to get a hyperlink hand (or somethin...

Excel nested IF formula question
I have a question regarding Nested If statements in Excel 2003. I have a commission structure below that needs to be nested 0-$50K = 10% 50-100K = 20% 100-150K = 25% 150-200K = 30% 200K+ - 35% For example: Fee commission rate commission 19,125 10% 1,912.50 8,000 10% 800.00 8,000 10% 800.00 8,000 10% 800.00 Total Billings: 43,125 Here is where I am running into a problem. At this ...

VBA Question #3
Sub sheets_list() Dim a As Long Dim s As Long Dim shtName As String s = 4 For a = 1 To Sheets.Count shtName = Sheets(a).Name Sheets(a).Hyperlinks.Add anchor:=Cells(a, s), Address:="", SubAddress:="'" _ & shtName & "'!A1", ScreenTip:=shtName, TextToDisplay:=shtName Next a End Sub My understanding is that the s = 4 determines the column where the list of worksheets should be returned, and this seems to be correct when I change the value. Also if I change a = 1 to a = 5 it starts the list in Cell D5 which is what I want. BUT......changing t...

Question about Messages
Hello, Is their anyway that I can have an email sent to me placed in a specific folder upon arrival, on Microsoft Outlook 2003? Any suggestions or help would be greatly apreciated. Thanks Oscar On Thu, 22 Dec 2005 18:31:01 -0800, "Oscar N. Fuentes-Guzman" <OscarNFuentesGuzman@discussions.microsoft.com> wrote: > >Is their anyway that I can have an email sent to me placed in a specific >folder upon arrival, on Microsoft Outlook 2003? > In Outlook Help, look under rules. -- <<<SgtRich>>> Chicago, Illinois, USA ...

WDF Interrupt question
I'm sorry I just start learning windows drivers development. I'm looking at Interrupt servicing in drivers in WDF. WdfInterruptCreate create the interrupt object but where do we put the information about interrupt vector? I noticed we can get vector by using WdfInterruptGetInfo, but where do we set it? I think I have found where it comes from. From Hardware Resource list, which is filled by PnP Manager. On Mar 22, 12:56=A0am, mpefareo <mpefa...@discussions.microsoft.com> wrote: > I'm sorry I just start learning windows drivers development. I'm looking ...

Question on Sorting by (date, etc)
I have a column (A) which sre dates. If I select the column heading and click either the sort ascending or desending button, the date column alone sorts independent of the other eight columns that comprise the entire entry. How would I go about being able to sort by a particular column and have everything sort with it? I have other columns that I would like to sort by sometimes too, like "color", "type", etc. Thanks for reading! select all the columns and now go to data | sort . On Feb 20, 11:21=A0pm, "Ed" <2...@333.com> wrote: > I have a column...

Question--Payment and Deposit order in advance register
Hi Everyone: I just purchased MS Money 2006 and have a question on the manner transactions are posted in the advanced register. I noticed that when both payment and deposit transaction are entered on a single date, the transactions are sorted so that payments are listed first and deposits are listed last. This means that all of the previous payment transactions for that date are drawn from the account without the benefit of the deposit. So payments made against the deposit make the account appear to have insufficient funds for those transactions. Is there a setting to disable the auto...