Question about Computers & Internet

1 Answer

Vb6 source code is not compiling.

I am trying to compile a source code of vb6 name building the time tracking system. The problem is somewhere in procedure. Kindly let me know the solution. The code is
Private Sub cmdOK_Click()
Dim sngBilledTime As Single, iMinutes As Integer, iHours As Integer
Dim iResponse As Integer
If txtAmountOfTime.Text = "0.00" Then
Msgbox "Your must enter the time spent."
txtAmountOfTime.SetFocus
Exit Sub
ElseIf txtBillingRate.Text <= 0 Then
Msgbox " You must enter the Billing Rate."
txtBillingRate.SetFocus
Exit Sub
ElseIf lblBillingName.Caption = " " Then
lblBillingName.Caption = InputBox("Please enter your name:")
End If
iResponse = Msgbox("Do you want to perview the invoice?", vbYesNo, "Invoice")
If iResponse = vbNo Then
End
Else
Load frmInvoice
With frmInvoice
.lblBilledBy .Caption = frmBillingInfor.lblBillingName
.lblClient .Caption = frmBillingInfo.lstClient.Text
.lblDate .Caption = frmBillingInfo.mskDate.Text
.lblRate.Caption = Format(frmBillingInfo.txtBillingRate.Text, "Rs ####.00")
.lblWorkCategory .Caption = frmBillingInfo.cboCategory.Text
If frmBillingInfo.optByHour.Value = True Then
.lblHourOrJob.Caption = "an Hour"
iMinutes = Val(Right(Me.textAmountOfTime.Text, 2))
iHours = Left(Me.txtAmountOfTime.Text, (InStr(1, Me.txtAmountOfTime.Text, ":") - 1))
Select Case iMinutes
Case Is < 15
If iHours > 0 Then
sngBilledTime = iHours
Else
sngBilledTime = 0.5
End If
Case Is >= 15 And iMinutes <= 30
sngBilledTime = iHours + 0.5
Case Is > 15 And iMinutes <= 30
sngBilledTime = iHours + 1
End Select
.lblTotalAmount.Caption = Format(frmBillingInfo.txtBillingRate.Text * sngBilledTime, "Rs####.00")
.lblTotalTime.Caption = sngBilledTime
Else
.lblHourOrJob = "form item"
.lblTotalTime = "N/A"
.lblTotalAmount = Format(.lblRate.Caption, "Rs####/00")
End If
End With
Unload Me
frmInvoice.Show
End Sub
On compilation the message "invalid use of property" is coming and invoice window is not displayed.

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Master
  • 981 Answers

What the heck are you compiling it with that doesn't give a line number for that error? Pay attention to the titles of messageboxes! Perhaps noting what lines you changed from the original will give a clue to narrow it down, but I expect you addressed an object with a property (object.property) in a context that can't be expected to generate or use that property as you gave it. Moreover there are spaces in object names, it seems....

Posted on Jun 10, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Can you give an example of compiler using vb?


Dim parameters As New CompilerParameters() Dim results As CompilerResults parameters.GenerateExecutable = True parameters.OutputAssembly = Output results = icc.CompileAssemblyFromSource(parameters, SourceText)
The code above uses the CompilerParameters object to tell the compiler that you want to generate an executable file (as opposed to a DLL) and that you want to output the resulting assembly to disk. The call to CompileAssemblyFromSource is where your assembly gets compiled. This method takes your parameters object and the source code, which is a string. Once you compile your code you can check to see if there were any compilation errors. We use the return value from CompileAssemblyFromSource, which is a CompilerResults object. This object contains an errors collection, which contains any errors that occurred during the compile.
There are other options for compiling, such as compiling from a file. You can also batch compile, which means you can compile multiple files or sources at the same time. Additional information on these classes is available on MSDN Online:

Feb 17, 2011 | Microsoft Visual Basic 6.0 for PC

1 Answer

VB6 error 432 File or Class name not found during automation


The GetObject function requires either a valid file name with a path specification, or the name of a class that is registered with the system. This error has the following cause and solution:

The name specified for file name or class in a call to the GetObject function could not be found.
Check the names and try again. Make sure the name used for the class parameter matches that registered with the system.

Mar 08, 2010 | Computers & Internet

1 Answer

Problems with VB6 Make .EXE command:


I guess your compiling logs are absent, or have been corrupted, which are only used to when you publish/make an executable.

To Confirm this, Make your EXE through Command Line Compiler, and How See this

If its still not working and your Project is important, then make a blank project and copy paste all Source and Objects there.

Regards,
Waqar.

Aug 18, 2009 | Microsoft Computers & Internet

1 Answer

How to extract MAC address of vista installed


Here's a piece of VBScript code that performs the function:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapter",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_NetworkAdapter instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "MACAddress: " & objItem.MACAddress
Next

You can test this on your machine to see that it works properly. I'm no longer coding with VB6 and don't have the compiler & tools loaded on any of my machines to convert and test there. It should be a simple matter to convert this script to VB6 code.

Jun 27, 2009 | Microsoft Computers & Internet

1 Answer

I want to change Hdd volume id through VB6


If this is at all possible, you would have to make use of the Win32API via your VB6 application. I do not believe that capability is built into VB6.

Mar 20, 2009 | Microsoft Visual Basic Professional...

1 Answer

It is like a mini project for me.can i get the full coding... Answer This...


Hi,

You can find numerous source files/projects on following links:
  1. http://www.a1vbcode.com/
  2. http://www.planet-source-code.com/vb/default.asp?lngWId=1#categories
  3. http://www.freevbcode.com/
  4. http://www.vbcode.com/
  5. http://www.vbcodesource.com/
  6. http://www.vb6.us/http://www.vb6.us/

Just go through them. I'll suggest you to play around code, its very interesting RAD tool.

Hope this helps you.

Thanks.

Mar 15, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

I want to open a jpg and doc file through command button in vb6


try to convert it to vb6 file and open it via vb6.... heres the link >>>> http://3d2f.com/tags/vb6/converter/registered/software/

Feb 28, 2009 | Microsoft Visual Basic 6.0 for PC

2 Answers

What is a compiler and ite story


A compiler takes code that you have writin, and 'compiles' it into machine language code ex.10010011, a language that your computer can understand and execute.

Jan 15, 2009 | Computers & Internet

1 Answer

RUN TIME ERROR 2147217842(80040e4e)


have u check the net framework version of the os ur using

Dec 18, 2007 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

87 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

101544 Answers

David Payne
David Payne

Level 3 Expert

14160 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...