The quantity of price in floating is not showing on msgbox as floating instead of showing integer
i have a project in vb 6.0. its simple project of a sales purchase. The quantity prices are in floating value but problem is that whenever i made a sales order the prices are in rounded. not in floating value. kindly suggest me what to do
See also questions close to this topic
VB 6.0 error while accessing web service: 2146697208
I am getting error : -2146697208, while sending xml to payment gateway web service. The application is developed in VB6.0 and the OS is Microsoft windows server 2003.
And also the code works fine in Windows XP, and i verified the same with third party tools for testing Web Services (SOAP UI) in Windows Embedded Standard system and it works fine. Looks like the issue is related to VB6.0 and the OS. Please help.
On Error GoTo 0 'Set XMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0") PaymentURL = "https://testpayments.globalone.me/merchant/xmlpayment" Dim http As Object Set http = CreateObject("MSXML2.XMLHTTP.6.0") http.Open "POST", PaymentURL, False http.setRequestHeader "Content-Type", "text/xml" http.setRequestHeader "User-Agent", "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405" http.send (xmldata) (error is thrown here)
Please help me.
An event is a (n) _______________ (in Visual Basic 6.0)
a) Activity performed by computer Regularly
b) Function that executes automatically
c) Block of code in the program d) None
VB6 How can this be done?
Lets say there is table like this
CREATE TABLE [dbo].[Table_A] ( [A_Row_No] [int] NOT NULL, [A_Text] [char](10) NULL ) CREATE TABLE [dbo].[Table_B] ( [B_Text] [char](200) NULL ) INSERT INTO Table_B VALUES ( '012345678901234567890123456789012345678901234567890123456789') INSERT INTO Table_B VALUES ( '012345') INSERT INTO Table_B VALUES ( '01234567890123')
And I do something like below
Dim strSQL As String Dim RowNo As Long Dim myEnv As myEnvironment Dim myCon As myConnection Dim myRS As rdoResultset RowNo = 0 strSQL = "" strSQL = strSQL & " SELECT * FROM Table_B" Set myEnv = myEnvironments(0) Set myCon = myEnv.OpenConnection("", rdDriverNoPrompt, True, MyCon) Set myRS = myCon.OpenResultset(strSQL, rdOpenKeyset, rdConcurReadOnly) Do Until myRS.EOF = True RowNo = RowNo + 1 strSQL = "" strSQL = strSQL & " INSERT INTO Table_A" strSQL = strSQL & " VALUES" strSQL = strSQL & " (" & RowNo & ", '" & myRS!B_Text & "')" myCon.Execute (strSQL) myRS.MoveNext Loop
Since A_Text is char(10) while B_Text has char(200),
It will end up in error when B_Text is more than char(10).
I want to cut B_Text when it is more than char(10) and add 1 to RowNo.
So the result I want to get is like below:
A_Row_No A_Text 1 0123456789 2 0123456789 3 0123456789 4 0123456789 5 0123456789 6 0123456789 7 012345 8 0123456789 9 0123
Before save, prompt message box with yes/no/cancel. Yes calls Macro, No continues to save, Cancel exits sub
I already have a successful "custom save" macro to save-as with a date stamp. I just want to have a message box ask to run it when someone tries to manually save. I essentially need "yes" to run the macro, "no" to save normally, and "cancel" to exit sub.
However, whenever I file>save, or ctrl+s, it just saves without prompting.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim answer As VbMsgBoxResult answer = MsgBox("Would you rather Save-As copy with date stamp?", vbYesNoCancel + vbQuestion + vbDefaultButton1, "You are overwriting the document!") If answer = vbYes Then Call filesave ElseIf answer = vbNo Then ActiveWorkbook.Save Else Exit Sub End If End Sub
Focus to MgsBox when Excel is not active
I am running a VBA script on my computer. The script takes a few minutes to execute and while waiting I am checking other things in my computer. To get my attention once the script has finished running, I have included a
MsgBoxat the end of my script. However, because Excel is not active/selected when the script finishes, I cannot see it - only when I reactivate/select Excel.
How can I bring into focus the
MsgBoxwhen Excel is not active? I have already tried the following tweaks but they do not work:
... ThisWorkbook.Activate MsgBox "..." ...
AppActivate() (this command threw an error):
... AppActivate("Microsoft excel") MsgBox "..." ...
VBA MsgBox Yes/No
When I select No in my message box prompt, the document still closes. I want it to stay open when i select no. I'm not sure how to do this. Thanks.
Option Explicit Sub b() 'declares docX as a document and stores it Dim docX As Documents 'opens the document file Application.Documents.Open FileName:="C:\Users\johnr\OneDrive\Documents\CIS 208 VBA\Rimando_Input_Box.docm" 'prompts the user to select either Yes or No MsgBox Prompt:="Close document?", _ Buttons:=vbYesNo 'If the user selects the Yes button then the document closes without making save changes. If vbYes Then Application.ActiveDocument.Close SaveChanges:=wdPromptToSaveChanges Else 'Keep the document open End If End Sub