Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:10:34+00:00 2026-05-25T12:10:34+00:00

Option Strict On Public Class Form1 ‘Project: ‘Author: ‘Date created: 9/8/2011 ‘Program Description: Program.

  • 0
Option Strict On

Public Class Form1
'Project:  
'Author: 
'Date created: 9/8/2011
'Program Description: Program.

Private Sub btnData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnData.Click

    '0. Declare variables
    Dim customerName As String
    Dim phoneNum As String
    Dim ticketPrice As Double
    Dim firstName, lastName As String
    Dim position As Integer
    Dim amountPaid As Double
    Dim areCode As String

    '1. Collect data: Customer name, phone number, ticket amount, and cash paid (use an input box)
    'get customer name from a textbox
    customerName = CStr(txtCustName.Text)

    'get phone number from a masked textbox
    phoneNum = mskPhone.Text

    'get ticket price from a textbox
    ticketPrice = CDbl(Val(txtTicket.Text))

    'get cash paid from a input box
    amountPaid = CDbl(Val(InputBox("Cash paid", "Lab2", "20")))

    '2. Rearrange name (Last, First)
    position = customerName.IndexOf(" ")
    firstName = customerName.Substring(0, position)
    lastName = customerName.Substring(position + 1)

    '3. Extract area code
    areCode = phoneNum.Substring(1, 3)

    '4. Calculate the change

    '5. Print data. Use the working version as a reference for your output.
    'print customer name

    lstDisplay.Items.Add("Customer Name: " & lastName & ", " & firstName)

End Sub

End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:10:35+00:00Added an answer on May 25, 2026 at 12:10 pm

    The error is fairly self-explanatory. txtCustName is used, but not defined, in Form1. You’ll need to define the variable before you can use it, in a syntax like:

    Dim txtCustName As Textbox
    

    Does txtCustName (which I’m assuming is meant to be a Textbox) exist on your form? If not, create it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Option Explicit On Option Strict On Public Class Class1 Dim l As List(Of A)
I have created a simply Pizza program (for a summer project not education related)
I saw this post: Typos… Just use option strict and explicit please.. during one
Option is implicitly convertible to an Iterable - but why does it not just
Home Option 1 Option 2 And I apply the styles with this classes #contentheader
Which option is better from Best practices point of view and from performance point
Which option is better to execute window.setTimeout and why? Option A: window.setTimeout(somefunc,0); Option B:
First option: SELECT Table1.* ,Table2.Price AS Price FROM Table1,Table2 WHERE Table1.ID = Table2.ID Second
Where is the option in Visual Studio to make the Home key go to
What does the option convert to web application do if I select it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.