Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB 2005 InputBox help

Featured Replies

I'm pretty much a noob with VB so bare with me please. I'm trying to write a Grocery Calculator program that uses the InputBox. I can't seem though to get it to work when formating it to Currency. You click on a button and it brings up the InputBox, you then enter an amount and press the OK button. This should then place the amount into the proper textbox and format it to currency. If anybody could help, I would much appreciate it.

Dim strInputBox As String

Dim decItemPrice As Decimal

strInputBox = InputBox("Enter item price", "Item Price")

decItemPrice = Convert.ToDecimal(strInputBox)

txtItemPrice.Text = FormatCurrency(decItemPrice)

Edited by footballking3420


Dim strInputBox As String

Dim decItemPrice As Decimal

strInputBox = InputBox("Enter item price", "Item Price")

decItemPrice = Convert.ToDecimal(strTextBox)

txtItemPrice.Text = FormatCurrency(decItemPrice)

Try changing the red highlighted text to be the same variable name.

  • Author

That was just a typing error by me. They are the same variable name in the actual code. In the debugger after running the program, I get an error that states, "Input string was not in correct format" for decItemPrice = Convert.ToDecimal(strInputBox)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.