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."
Exit Sub
ElseIf txtBillingRate.Text <= 0 Then
Msgbox " You must enter the Billing Rate."
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
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
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
.lblHourOrJob = "form item"
.lblTotalTime = "N/A"
.lblTotalAmount = Format(.lblRate.Caption, "Rs####/00")
End If
End With
Unload Me
End Sub
On compilation the message "invalid use of property" is coming and invoice window is not displayed.

Posted by rajesh765 on


1 Answer

Steve Nordquist

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points


    An expert that got 10 achievements.


    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 ( 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


Add Your Answer

Uploading: 0%


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



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.


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

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...


You can find numerous source files/projects on following links:

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

Hope this helps you.


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 >>>>

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:

92 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts


Level 3 Expert

13434 Answers


Level 3 Expert

85239 Answers

Brad Brown

Level 3 Expert

18372 Answers

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

Answer questions

Manuals & User Guides