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
AxMSForms COM library is missing
I've got an old vb application that was developed in VS 2003. I carefully upgraded it to vs 2015. This application uses some COM libraries. When I try to build the application, It gives an error:
Severity Code Description Project File Line Suppression State Error BC30002 Type 'AxMSForms.AxImage' is not defined
I found that some dll named AxMSForms.dll is causing the issue. Where to get those COM library files.
Feel free to ask if the question is not clear.
VB6 Automation Error when calling Add on previously created MultiPage
I want to generate a bunch of MultiPages and create new Pages dynamically in my app, but i'm getting Run-time error '-2147417848 (80010108)': Automation error The object invoked has disconnected from its clients.
Steps to reproduce
In a Class Module named TestClass:
Public WithEvents TestMultiPage As MsForms.MultiPage Sub createPage() TestMultiPage.Add End Sub
In a UserForm named TestForm:
Dim TestInstances as New Collection Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X as Single, ByVal Y as Single) If Button = fmButtonRight Then Dim TestInstance as New TestClass Set TestInstance.TestMultiPage = Me.Controls.Add("Forms.MultiPage.1") TestInstances.Add TestInstance End If End Sub Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Dim TestInstance As TestClass: Set TestInstance = TestInstances(1) TestInstance.createPage End Sub
When i right-click the UserForm twice, i get two MultiPages. Then i double-click the UserForm, expecting the first MultiPage to have a new Page. But i hit the automation error at
TestMultiPage.Add, even though all the variables seem present from the Locals window.
What am i missing?
Crystal Reports 6 "Invalid Formula Name"
My VB6 application runs a report that has 4 parameter fields, with the report made in Crystal Reports version 6.
I'm trying to pass values in to populate my parameter fields, as below.
Rpt_BB.ReportFileName = Report_Path$ & "BBCINV.RPT" Rpt_BB.WindowTitle = "Bottle Bank - Customer Invoice" Rpt_BB.DataFiles(0) = DB_Name$ Rpt_BB.DataFiles(1) = DB_Name$ Rpt_BB.DataFiles(2) = DB_Name$ Dim invoiceNumber As String Dim invoiceDate, dateFrom, dateTo As Date invoiceNumber = txtInvoiceNumber.Text invoiceDate = Format(Now, "dd/MM/yyyy") dateFrom = Format(Msk_Date_From.Text, "dd/MM/yyyy") dateTo = Format(Msk_Date_To.Text, "dd/MM/yyyy") Rpt_BB.ParameterFields(0) = "invoiceNumber;" & Trim(invoiceNumber) & ";TRUE" Rpt_BB.ParameterFields(1) = "invoiceDate;" & invoiceDate & ";TRUE" Rpt_BB.ParameterFields(2) = "dateFrom;" & dateFrom & ";TRUE" Rpt_BB.ParameterFields(3) = "dateTo;" & dateTo & ";TRUE" End If Rpt_BB.SelectionFormula = Formula$ Rpt_BB.WindowTop = 20 Rpt_BB.WindowLeft = 20 Rpt_BB.WindowHeight = Screen.Height / 16 Rpt_BB.WindowWidth = Screen.Width / 16 If Opt_Destination(0) Then Rpt_BB.Destination = 0 ElseIf Opt_Destination(1) Then Rpt_BB.Destination = 1 End If Pnl_Status = "Sending Report..." Rpt_BB.Action = 1
However, I'm getting an error when running the report
Invalid formula name
The report runs fine in Crystal Reports itself.
What is causing the error?
Access File creating Excel With MessageBox
I've gotten my Access File pulling data from a database and turning it over into excel files that are auto generated and emailed. What I can't figure out is how to make the excel file have a message box pop up upon closing the excel file. I know this is possible to do as I've done it many times on regular excel files.
I believe that the issue is within the access file only generating .xlsx files and not .xlsm files. OR that the VBA code I am trying to use isn't proper (either in the placing of the code or the code itself.
If you can solve it and are wondering what should the message box say, I would simply like a "Have you complete the task?" Yes/No box nothing crazy.
FilePath = "\\ms000ew01\Departments\Reporting\Reports" FileName = FilePath & "\" & GrName & ShipDate & Timestamp Attachfile = FileName & ".xlsm" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Draft", FileName, True DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Turn", FileName, True DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Final", FileName, True Dim xlApp As Object Set xlApp = CreateObject("Excel.Application") With xlApp .Visible = False .Workbooks.Open (FileName & ".xlsm") .Sheets("Draft").Select .ActiveSheet.UsedRange.Font.Name = "Tahoma" .ActiveSheet.UsedRange.Font.Size = 8 xlApp.Cells.EntireColumn.AutoFit xlApp.Cells.EntireRow.AutoFit .Sheets("Turn").Select .ActiveSheet.UsedRange.Font.Name = "Tahoma" .ActiveSheet.UsedRange.Font.Size = 8 xlApp.Cells.EntireColumn.AutoFit xlApp.Cells.EntireRow.AutoFit .Sheets("Final").Select .ActiveSheet.UsedRange.Font.Name = "Tahoma" .ActiveSheet.UsedRange.Font.Size = 8 xlApp.Cells.EntireColumn.AutoFit xlApp.Cells.EntireRow.AutoFit Set xlApp = Nothing Dim OutApp As Object Dim MailObj As Object Set OutApp = CreateObject("Outlook.Application") Set MailObj = OutApp.CreateItem(olMailItem) With MailObj .To = EmailTo .Subject = GrName & " Report" .Body = "Attached is your report" .Attachments.Add Attachfile .Send End With Set OutApp = Nothing Set MailObj = Nothing rst.MoveNext End With End Sub
'MsgBox' is not declared. It may be inaccessible due to its protection level
I have been using vb.net from a long time, but never had this issue. For some reason Intellisense is not detecting MsgBox(). When I hover over the highlighted red line it says "'MsgBox' is not declared. It may be inaccessible due to its protection level" and in the potential fixes it tries to create a new function named MsgBox(). Below is the code:
Imports System Imports System.Data.SqlClient Imports System.Runtime.InteropServices Imports System.Web.Configuration Imports Microsoft.Office.Interop.Outlook Public Class ConferenceRooms Inherits System.Web.UI.Page Dim SQLConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("MyDB").ConnectionString) Dim SQLcommand As New SqlCommand Dim SQLAdapter As SqlDataAdapter Dim SQLDataTable As DataTable Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'MsgBox(LBTest.Attributes("title")) 'Dim lb As Label = CType(Me.Controls("HR Conference Room"), Label) If Not IsPostBack Then Dim Query1 As String Query1 = "Select Location_ID from LCSConference_Locations where vacant = 1" RunQuery(Query1) Dim OrganizerEmail As String = OrgEmail.Value Dim Agenda As String = MeetAgenda.Value Dim Location As String = MeetLocation.Value MsgBox("Hello") End If End Sub
I am trying To emulate MsgBox. Doing This I have encountered an strange Trouble. How Can I dim arguments like vbquestion or vbyesno in my early function which calls an Userform ? (You can have only one or both of them at time by using "+" between these arguments.) Is it Possible at all?