473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How to alter a Yes/No Messagebox to say Hold/Rehold isntead?

kirubagari
158 100+
Can anyone help me to slightly alter a Yes/No Messagebox, in a way that buttons' captions are Hold/Rehold, instead of Yes/No?

Thanks
Mar 3 '11 #1
4 1437
Guido Geurs
767 Expert 512MB
In the VB msgbox you can't change the caption of the Msgbox.
I have a msgbox of my own in which I can put what I want (see attachment)
Attached Files
File Type: zip GGmsgbox_v3.zip (3.8 KB, 69 views)
Mar 3 '11 #2
kirubagari
158 100+
Thanks guido..i was searching for the sample code but couldn't find.thanks alot again
Mar 3 '11 #3
kirubagari
158 100+
This is my code..I wana put 2 option..

The hold is on hold..Are you want to rehold or apply multiplehold for the particular lot.


If user choose rehold ,it go to the right function.If multiplehold it goes to another function..How to allow user to choose either 1 option rather than using command button..Should i enhance the code?


here is my code:
Expand|Select|Wrap|Line Numbers
  1. If sActionType = "Hold" And LCase(rc.Lot.status) = "hold" Then
  2.         'If any dispatch list is selected, have to select Hold rule from Activities>WIP>Hold Lot, if from lot query, just right click and Hold Lot.
  3.         bRehold = False
  4.         'sReturnText = "This lot is already on hold."
  5.         iSelect = LSIMsgBox("This lot is already on HOLD. Are you sure to re-hold with different hold code and comment?", vbYesNo + vbExclamation, rc.ruleName)
  6.         If iSelect = vbNo Then
  7.             GoTo Cancel
  8.         Else
  9.             bRehold = True
  10.         End If
  11.     End If
  12.  
  13.  
  14. Public Function LSIMsgBox(ByVal sPrompt As String, _
  15.         Optional ByVal vButtons As Variant, _
  16.         Optional ByVal vTitle As Variant, _
  17.         Optional ByVal vHelpfile As Variant, _
  18.         Optional ByVal vContext As Variant) _
  19.         As Integer
  20.     '*** START FAILSAFE ***
  21.     On Error GoTo FailSafe_Error    'setup error handler
  22.     Push "Main.bas", "Function LSIMsgBox", "(" & "sPrompt=" & sPrompt & ", vButtons=" & "" & IIf(InStr("23456781117", VarType(vButtons)), vButtons, "<variant>") & ", vTitle=" & "" & IIf(InStr("23456781117", VarType(vTitle)), vTitle, "<variant>") & ", vHelpfile=" & "" & IIf(InStr("23456781117", VarType(vHelpfile)), vHelpfile, "<variant>") & ", vContext=" & "" & IIf(InStr("23456781117", VarType(vContext)), vContext, "<variant>") & ")"
  23.     Trace "Enter", 9
  24.     '*** STOP FAILSAFE ********************************************************************************************************************************
  25.  
  26.  
  27.     Dim iHoldMousePointer As Integer
  28.  
  29.     iHoldMousePointer = Screen.MousePointer
  30.     Screen.MousePointer = vbDefault
  31.  
  32.     Dim frm As frmLSIMsgBox
  33.     Set frm = New frmLSIMsgBox
  34.  
  35.     Dim sReply As String
  36.     '  Check to see if being called by the GUI.
  37.     If Not rc Is Nothing Then
  38.         If rc.bGui Or g_bGui = True Then 
  39.             '  Write out to the trace log.
  40.             Trace "MessageBox Displayed: " + sPrompt, 4
  41.             Select Case LSIMsgBox
  42.                 Case vbOK
  43.                     sReply = "vbOK"
  44.                 Case vbCancel
  45.                     sReply = "vbCancel"
  46.                 Case vbAbort
  47.                     sReply = "vbAbort"
  48.                 Case vbRetry
  49.                     sReply = "vbRetry"
  50.                 Case vbIgnore
  51.                     sReply = "vbIgnore"
  52.                 Case vbYes
  53.                     sReply = "vbYes"
  54.                 Case vbNo
  55.                     sReply = "vbNo"
  56.             End Select
  57.             Trace "Operator Selected: " + sReply, 4
  58.         End If
  59.     End If
  60.  
  61.     Unload frm
  62.     Set frm = Nothing
  63.  
  64.     Screen.MousePointer = iHoldMousePointer
  65.  
  66.     '*** START FAILSAFE ********************************************************************************************************************************
  67. FailSafe_Exit:
  68.     Trace "Exit", 9
  69.     Pop
  70.     Exit Function
  71. FailSafe_Error:
  72.     ' *** Insert Special Error Handling Here ***
  73.     'LogError
  74.     Err.Raise Err.Number, , Err.Description
  75.     Resume FailSafe_Exit             'default is to exit this procedure
  76.     '*** STOP FAILSAFE ***
  77. End Function
Mar 7 '11 #4
Guido Geurs
767 Expert 512MB
It's also possible to add options in the msgbox (see attachment)
Attached Files
File Type: zip GGmsgbox_options_v3.zip (4.0 KB, 61 views)
Mar 7 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dylan Nicholson | last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra parentheses when adding multiple columns to a table: ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)) vs ...
1
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT; But get an error message certainly since my...
0
by: alex_f_il | last post by:
The class centers MessageBox inside the parent rectangle. Enjoy! using System; using System.Windows.Forms; using System.Text; using System.Drawing; using System.Runtime.InteropServices; ...
2
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is it possible to modify the text in the MessageBox class? There are a couple of buttons with a standard text. What i want is to set a text of my own. I have inherited the class, but...
11
by: Graham Charles | last post by:
I'm writing a control inheriting from ComboBox, and I'd like to add an entry to the ContextMenu for that combo box. I have no problem if I create an entirely new ContextMenu from scratch, but I'd...
4
by: Jeff Kish | last post by:
Hi. I have a database I need to supply something (I'm assuming a t-sql script.. maybe something else is better) to update customer tables with. The operations include mostly changing varchar...
2
by: RamaKrishna Narla | last post by:
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1,...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
1
by: vasilip | last post by:
I'm testing out db2 for a project I'm starting that requires proper xml support and I can't seem to get both xml and spatial data to work well in the same table. Once having created a table...
11
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.