473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

help with Command buttons in VB 6.0

1
I keep getting runtime 424 error object required when tring to run program works fine untill it gets to caculate commission any assistants would be appreciated.








Private Sub cmdCalc_Click()
'caculate total commission
lblCommision.Caption = Val(txtSales.Text) * Val(txtRate.Text)
lblCommission.Caption = Format(lblCommission.Caption, "currency")
cmdPrint.SetFocus

End Sub

Private Sub cmdClear_Click()
'Clears screen for next commission.
txtName.Text = ""
txtSales.Text = ""
txtTerritory.Text = ""
lbtsales.Caption = ""
txtRate.Text = ".10"
lblCommision.Text = ""
txtName.setfoucus


End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub cmdPrint_Click()
' Hide command buttons before printing.
cmdCalc.Visible = False
cmdPrint.Visible = False
cmdClear.Visible = False
cmdExit.Visible = False

PrintForm
'displays command buttons after form is printed
cmdCalc.Visible = True
cmdPrint.Visible = True
cmdClear.Visible = True
cmdExit.Visible = True
cmdClear.SetFocus

End Sub


Private Sub Label3_Click()



End Sub

Private Sub Label5_Click()
.

End Sub

Private Sub lblcomission_Click()

End Sub

Private Sub Label1_Click()

End Sub

Private Sub txtRate_Change()
txtRate.Text = Val(0.1)
End Sub
Jun 18 '06 #1
3 4959
sashi
1,754 Expert 1GB
Hi there,

always remember when u get the "object required" error msg that means u are using some control name that doesn't exist or has been deleted from the container or the form.. check the form properties by pressing F4 or another shortcut is.. the name of the deleted control will apprear under the form general declare section..

it could be any label, command button, textbox.. or perhaps make sure the naming convention of every control is same under the cmdCalc() as well as the contol properties..

tips to make sure the naming convention is followed.. always start your line of code with the "me." keyword.. i.e. "me." .. when you type the "me." keyword.. all the controls on the form is listed.. check it out.. good luck my fren
Jun 18 '06 #2
CaptainD
135 100+
Do a spell check, one of your lables is spelled wrong.
lblCommision.Caption = Val(txtSales.Text) * Val(txtRate.Text)
lblCommission.Caption = Format(lblCommission.Caption, "currency")
Jun 18 '06 #3
sashi
1,754 Expert 1GB
Hi CaptionD,

thanks for highlighting that portion of the code.. gee i almost missed that out.. take care buddy.. :)
Jun 18 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kevin McLean | last post by:
I have serveral ASP web pages containing command buttons that perform different functions. This web site has been running for serveral months without any problems. I had taken a vacation and when...
2
by: kma | last post by:
I am designing an Access 2000 database on a computer running Windows 98. I have one form with several tabs; all of which have sub forms, some with a subform on a subform. For example, on my...
1
by: KD | last post by:
I am developing an application that will be used with a touch screen monitor, so it needs to be driven by command buttons. I have a products table which i need to use to create a form with an...
7
by: UGH | last post by:
I am adding image buttons dynamically and I need to add event handler when the user clicks on one of those image buttons which will have different id for reports. Here is my code LnkImage =...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
0
by: Ian Ceicys | last post by:
I’ve been tasked with doing documentation on the project I’ve recently joined. Here’s what I’m looking for in terms of documentation. I want to generate a diagram from a huge .net 1.1...
1
by: hugz via AccessMonster.com | last post by:
The design view of my form is this.. I hav command buttons namely cmdRecord, cmdEdit and cmdUpdate.. Ol of these command buttons are set into Enabled NO.. I switched it again to form view.. Then...
2
by: Doug | last post by:
MS Access 2000 Help says there is an Switchboard Manager in Tools->Add-ins. Only Add-in Manager is there, and no Add-ins are listed. Clicking Add New takes me to an Add-ins directory on C: (empty...
0
by: yabighelen | last post by:
HELP!!!!! I have to write a program that does this: Create a program that encrypts and decrypts a message... Inputs: A typed message Output: When the encrypt button is clicked the input...
3
JodiPhillips
by: JodiPhillips | last post by:
Hello everyone, there are many questions and answers relating to moving items between two listboxes here and on the net in general, however, none answer my specific problem. I have two listboxes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.