visual basic help

creamy5man

New Member
I got this program, and when users click a button, I want them to be able to change the name and price of a drink.

This is what I have so far.

Private Sub cmdChangeDrink_Click()
sdrinks(3) = InputBox("Enter Drink Name")
cprices(3) = InputBox("Enter Drink Price")
cmdChangeDrink = InputBox("Enter Drink Name")
End Sub

The first two lines of code work, and that changes the price and name in the array, but the last line doesn't work. That line I want to change the drink name on the actual interface. All the drink command buttons are called "cmdDrinks" and then have an index number from 0-7.

I dunno what I did, i'm stuck.

Any help, pleeease?
 
i assume this is a command button
cmdChangeDrink

in which case you need to specify which property you are intending to change with the line:
cmdChangeDrink = InputBox("Enter Drink Name")

do you want the text of the command button to change, in whichyou need to put
cmdChangeDrink.caption = InputBox("Enter Drink Name")
 
I may be wrong, but I think you need to define cmdChangeDrink by saying "dim cmdChangeDrink as modifier (string, integer, array, etc.) What is the error that you are getting in the error box at the bottom of the screen? I hope this helps.

~Jordan
 
Back
Top