im working on a vb project to design a juke box which plays a number of songs which is dependent on the money u enter. for example if £0.50p is enter 1 song is allowed to be selected or if £1.00 is entered 3 songs are allowed to be selected and displayed on a textbox etc. Ive started the coding but am stuck on a problem. when i enter money it should only let me select the number of songs allowed to but it doesnt it lets me keep on selecting without the limitations i have put there. ill paste my coding here( it isnt finished its done up to the point where im stuck) so ppl
plz correct me where im goign wrong.
-----------------------------------------------------------------------------------------------------------------------------------
Private Sub cmbSong_Click()
If cmbSong.Text = "1" Then
txtsongName = "Stan"
Me.txtartistname = "Eminem"
ElseIf cmbSong.Text = "2" Then
txtsongName = "Krishna"
Me.txtartistname = "Dido"
ElseIf cmbSong.Text = "3" Then
txtsongName = "Thriller"
Me.txtartistname = "Michael Jackson"
ElseIf cmbSong.Text = "4" Then
txtsongName = "Slave 2 u"
Me.txtartistname = "Britney Spears"
ElseIf cmbSong.Text = "5" Then
txtsongName = "Lavida loka"
Me.txtartistname = "Ricky Martin"
End If
End Sub
Private Sub cmdSelectSong_Click()
Dim songName As String
Dim artistName As String
Dim counter As Integer
Dim songcount As Integer
Dim i As Integer
If Text3.Text = "0:50" Then
counter = 1
ElseIf Text3.Text = "1:00" Then
counter = 3
ElseIf Text3.Text = "2:00" Then
counter = 8
End If
Select Case counter
Case 1
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case 3
counter = 0
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case 8
counter = 0
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case Else
MsgBox "ERROR", vbCritical
'txtartistname.Text = artistName
End Select
End Sub
Private Sub Form_Load()
MsgBox "Welcome!", vbInformation, "JukeBox Selector"
' settings for combo box initialisation values
cmbSong.AddItem "1"
cmbSong.AddItem "2"
cmbSong.AddItem "3"
cmbSong.AddItem "4"
cmbSong.AddItem "5"
End Sub
Private Sub quit_Click()
End
End Sub
plz correct me where im goign wrong.
-----------------------------------------------------------------------------------------------------------------------------------
Private Sub cmbSong_Click()
If cmbSong.Text = "1" Then
txtsongName = "Stan"
Me.txtartistname = "Eminem"
ElseIf cmbSong.Text = "2" Then
txtsongName = "Krishna"
Me.txtartistname = "Dido"
ElseIf cmbSong.Text = "3" Then
txtsongName = "Thriller"
Me.txtartistname = "Michael Jackson"
ElseIf cmbSong.Text = "4" Then
txtsongName = "Slave 2 u"
Me.txtartistname = "Britney Spears"
ElseIf cmbSong.Text = "5" Then
txtsongName = "Lavida loka"
Me.txtartistname = "Ricky Martin"
End If
End Sub
Private Sub cmdSelectSong_Click()
Dim songName As String
Dim artistName As String
Dim counter As Integer
Dim songcount As Integer
Dim i As Integer
If Text3.Text = "0:50" Then
counter = 1
ElseIf Text3.Text = "1:00" Then
counter = 3
ElseIf Text3.Text = "2:00" Then
counter = 8
End If
Select Case counter
Case 1
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case 3
counter = 0
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case 8
counter = 0
songName = Me.txtsongName.Text
artistName = Me.txtartistname.Text
txtsonglist.Text = songName & vbCrLf & artistName
Case Else
MsgBox "ERROR", vbCritical
'txtartistname.Text = artistName
End Select
End Sub
Private Sub Form_Load()
MsgBox "Welcome!", vbInformation, "JukeBox Selector"
' settings for combo box initialisation values
cmbSong.AddItem "1"
cmbSong.AddItem "2"
cmbSong.AddItem "3"
cmbSong.AddItem "4"
cmbSong.AddItem "5"
End Sub
Private Sub quit_Click()
End
End Sub