Computers & Internet Logo

Related Topics:

Posted on Apr 13, 2008
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

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.

1 Answer

Steve Nordquist

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 982 Answers
  • Posted on Jun 10, 2008
Steve Nordquist
Master
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.

Joined: Feb 22, 2008
Answers
982
Questions
2
Helped
216139
Points
2276

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

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

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

×

Loading...
Loading...

Related Questions:

0helpful
1answer

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:
1helpful
1answer

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.
0helpful
1answer

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.
0helpful
1answer

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.
0helpful
1answer

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.
1helpful
1answer

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.
0helpful
1answer

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/
0helpful
2answers

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.
0helpful
1answer

RUN TIME ERROR 2147217842(80040e4e)

have u check the net framework version of the os ur using
Not finding what you are looking for?

104 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

David Payne
David Payne

Level 3 Expert

14163 Answers

Brad Brown

Level 3 Expert

19190 Answers

Cindy Wells

Level 3 Expert

6713 Answers

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

Answer questions

Manuals & User Guides

Loading...