Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to programming. Needs Help

Status
Not open for further replies.

burton1986

Programmer
Sep 30, 2005
5
GB
I have made this program using Vb6. it works fine i have made several forms in which in design view i made dvd names wit pitures on then the cost of the movie and the amount sold would change everytime i clicked buy.

i put the names on the frames and then did a least popular and most popular dvds sold dependent on the amount sold

i also did a running total at the bottom that would count price of dvds sold.

i have 4 tabs movies tv shows music and total

but i would like to be able to add a button so that when i click it i can add new dvds and put them in a form.
because im forever gettin dvds and this would be easier than
changing the design everytime. i would like the new dvds entered into a new form if poss

thanks really need the help.
 
You want to be able to add new DVD's (into what i assume is a database backend)?

Do you have a different form for each DVD????

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
yeah into a database. i have the dvds at the moment on a tab but i would like them in a database that can be accessed. i think that this would be easier
 
So you aren't using a database at the moment?

Do you have the use of a database (e.g MS Access etc.)?

It might be better to dynamically show values from the database about the DVD's rather than hardcode them into the form.

There are literally hundreds of examples on this forum of connecting to, retreiving and displaying data from all kinds of DB's that should help you imensely.

Have you had a go at coding your app with a database?

If so could you show us what you've got so far?

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
i have access to access yes. can i send u my program then u can say what i can do thanks
 
I'm not able to look at your program unfortunately, but if you can post your code I/we can have a look at what you've got and try and help you that way.

Cheers

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Dim filmtotal As Currency
Dim tvtotal As Currency
Dim musictotal As Currency
Dim total As Currency

Private Sub Close_Click()
Unload Me
End Sub

Private Sub Command1_Click()
Text1.Text = Val(Text1.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 12.99
End Sub

Private Sub Command10_Click()
Text19.Text = Val(Text19.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 18.99
End Sub

Private Sub Command11_Click()
Text21.Text = Val(Text21.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 15.99
End Sub

Private Sub Command12_Click()
Text24.Text = Val(Text24.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 39.99
End Sub

Private Sub Command13_Click()
Text25.Text = Val(Text25.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 19.99
End Sub

Private Sub Command14_Click()
Text28.Text = Val(Text28.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 24.99
End Sub

Private Sub Command15_Click()
Text30.Text = Val(Text30.Text) + 1
Text46.Text = Val(Text46.Text) + 1
Text47.Text = Val(Text47.Text) + 34.99
End Sub

Private Sub Command16_Click()
filmtotal = (Val(Text10.Text * Val(Text1.Text)) + Val(Text11.Text * Val(Text2.Text)) + Val(Text12.Text * Val(Text3.Text)) + Text13.Text * Val(Text4.Text)) + Val(Text14.Text * Val(Text5.Text)) + Val(Text15.Text * Val(Text6.Text)) + Val(Text16.Text * Val(Text7.Text)) + Val(Text17.Text * Val(Text8.Text)) + Val(Text18.Text * Val(Text9.Text))
MsgBox "£" & Str(filmtotal) + " For movies dvd's "
Text32 = "£" & filmtotal & " For movies dvd's "
End Sub

Private Sub Command17_Click()
Text34.Text = Val(Text34.Text) + 1
Text48.Text = Val(Text48.Text) + 1
Text49.Text = Val(Text49.Text) + 12.99
End Sub

Private Sub Command18_Click()
Text36.Text = Val(Text36.Text) + 1
Text48.Text = Val(Text48.Text) + 1
Text49.Text = Val(Text49.Text) + 15.99
End Sub

Private Sub Command19_Click()
Text38.Text = Val(Text38.Text) + 1
Text48.Text = Val(Text48.Text) + 1
Text49.Text = Val(Text49.Text) + 16.99
End Sub

Private Sub Command2_Click()
Text2.Text = Val(Text2.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 12.99
End Sub

Private Sub Command20_Click()
tvtotal = (Val(Text20.Text * Val(Text19.Text)) + Val(Text22.Text * Val(Text21.Text)) + Val(Text23.Text * Val(Text24.Text)) + Text26.Text * Val(Text25.Text)) + Val(Text27.Text * Val(Text28.Text)) + Val(Text29.Text * Val(Text30.Text))
MsgBox "£" & Str(tvtotal) + " For Tv Shows "
Text39 = "£" & tvtotal & " For Tv Shows "
End Sub

Private Sub Command21_Click()
musictotal = (Val(Text33.Text * Val(Text34.Text)) + Val(Text35.Text * Val(Text36.Text)) + Val(Text37.Text * Val(Text38.Text)))
MsgBox "£" & Str(musictotal) + " For Music"
Text40 = "£" & musictotal & " For Music "
End Sub

Private Sub Command22_Click()
Text41.Text = "£" & (filmtotal + tvtotal + musictotal + total)
MsgBox "£" & (filmtotal + tvtotal + musictotal + total)
End Sub
Private Sub Command23_Click()
Dim MostPopsold As Integer
Dim popName As String
MostPopsold = 0
If Val(Text1) > MostPopsold Then
MostPopsold = Val(Text1)
popName = Frame1.Caption
End If

If Val(Text2) > MostPopsold Then
MostPopsold = Val(Text2)
popName = Frame2.Caption
End If

If Val(Text3) > MostPopsold Then
MostPopsold = Val(Text3)
popName = Frame3.Caption
End If

If Val(Text4) > MostPopsold Then
MostPopsold = Val(Text4)
popName = Frame4.Caption
End If


If Val(Text5) > MostPopsold Then
MostPopsold = Val(Text5)
popName = Frame5.Caption
End If

If Val(Text6) > MostPopsold Then
MostPopsold = Val(Text6)
popName = Frame6.Caption
End If

If Val(Text7) > MostPopsold Then
MostPopsold = Val(Text7)
popName = Frame7.Caption
End If

If Val(Text8) > MostPopsold Then
MostPopsold = Val(Text8)
popName = Frame8.Caption
End If

If Val(Text9) > MostPopsold Then
MostPopsold = Val(Text9)
popName = Frame9.Caption
End If

If Val(Text19) > MostPopsold Then
MostPopsold = Val(Text19)
popName = Frame10.Caption
End If

If Val(Text21) > MostPopsold Then
MostPopsold = Val(Text21)
popName = Frame11.Caption
End If

If Val(Text24) > MostPopsold Then
MostPopsold = Val(Text24)
popName = Frame12.Caption
End If

If Val(Text25) > MostPopsold Then
MostPopsold = Val(Text25)
popName = Frame13.Caption
End If

If Val(Text28) > MostPopsold Then
MostPopsold = Val(Text28)
popName = Frame14.Caption
End If

If Val(Text30) > MostPopsold Then
MostPopsold = Val(Text30)
popName = Frame15.Caption
End If

If Val(Text34) > MostPopsold Then
MostPopsold = Val(Text34)
popName = Frame16.Caption
End If

If Val(Text36) > MostPopsold Then
MostPopsold = Val(Text36)
popName = Frame17.Caption
End If

If Val(Text38) > MostPopsold Then
MostPopsold = Val(Text38)
popName = Frame18.Caption
End If
Text43 = popName
MsgBox popName
End Sub

Private Sub Command24_Click()
Dim leastPopsold As Integer
Dim popName As String
leastPopsold = 9999

If Val(Text1) < leastPopsold Then
leastPopsold = Val(Text1)
popName = Frame1.Caption
End If

If Val(Text2) < leastPopsold Then
leastPopsold = Val(Text2)
popName = Frame2.Caption
End If

If Val(Text3) < leastPopsold Then
leastPopsold = Val(Text3)
popName = Frame3.Caption
End If

If Val(Text4) < leastPopsold Then
leastPopsold = Val(Text4)
popName = Frame4.Caption
End If


If Val(Text5) < leastPopsold Then
leastPopsold = Val(Text5)
popName = Frame5.Caption
End If

If Val(Text6) < leastPopsold Then
leastPopsold = Val(Text6)
popName = Frame6.Caption
End If

If Val(Text7) < leastPopsold Then
leastPopsold = Val(Text7)
popName = Frame7.Caption
End If

If Val(Text8) < leastPopsold Then
leastPopsold = Val(Text8)
popName = Frame8.Caption
End If

If Val(Text9) < leastPopsold Then
leastPopsold = Val(Text9)
popName = Frame9.Caption
End If

If Val(Text19) < leastPopsold Then
leastPopsold = Val(Text19)
popName = Frame10.Caption
End If

If Val(Text21) < leastPopsold Then
leastPopsold = Val(Text21)
popName = Frame11.Caption
End If

If Val(Text24) < leastPopsold Then
leastPopsold = Val(Text24)
popName = Frame12.Caption
End If

If Val(Text25) < leastPopsold Then
leastPopsold = Val(Text25)
popName = Frame13.Caption
End If

If Val(Text28) < leastPopsold Then
leastPopsold = Val(Text28)
popName = Frame14.Caption
End If

If Val(Text30) < leastPopsold Then
leastPopsold = Val(Text30)
popName = Frame15.Caption
End If

If Val(Text34) < leastPopsold Then
leastPopsold = Val(Text34)
popName = Frame16.Caption
End If

If Val(Text36) < leastPopsold Then
leastPopsold = Val(Text36)
popName = Frame17.Caption
End If

If Val(Text38) < leastPopsold Then
leastPopsold = Val(Text38)
popName = Frame18.Caption
End If
Text42 = popName
MsgBox popName
End Sub

Private Sub Command3_Click()
Text3.Text = Val(Text3.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 15.99
End Sub

Private Sub Command4_Click()
Text4.Text = Val(Text4.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 14.99
End Sub

Private Sub Command5_Click()
Text5.Text = Val(Text5.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 16.99
End Sub

Private Sub Command6_Click()
Text6.Text = Val(Text6.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 18.99
End Sub

Private Sub Command7_Click()
Text7.Text = Val(Text7.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 12.99
End Sub

Private Sub Command8_Click()
Text8.Text = Val(Text8.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 17.99
End Sub

Private Sub Command9_Click()
Text9.Text = Val(Text9.Text) + 1
Text44.Text = Val(Text44.Text) + 1
Text45.Text = Val(Text45.Text) + 16.99
End Sub

Private Sub Timer1_Timer()
Text31.Text = Time
End Sub

Private Sub Timer2_Timer()
'MsgBox "Hello and welcome to My dvd sales. Please feel free to spend as much money as you like"
'CustomerName = InputBox("Please Enter Your Name", "DVD Sales")
'While Not IsDate(txtDate.Text)
' txtDate.Text = InputBox("Please Enter The Date", "", Date", "Date")
' If Not IsDate(txtDate.Text) Then
' MsgBox "Not A Date"
' End If
'Wend
Form2.Show (1)
Timer2.Enabled = False
End Sub


i havent added the database bit yet i dont know what to do
 
To use the database route you're basically going to have to start this again from scratch unfortunately. [sad]

You're best bet would be to check out the FAQ section as there are examples of pretty much everything you are going to need to use to accomplish your objective.

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
To get the best from these forums first read faq222-2244 carefully.
From the look of your code, you may need to start with a review of the basics! Try one of the many VB tutorials to set you off on the right path:

There are also some good articles on database design:

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
One of the things that will cut the length of your code by about 10 times will be to get up to speed on your understanding of arrays.

Well, there's a bunch of other things you need to know too. Here, how about this: first you need a clear plan. Suppose you write one out. Explain briefly and precisely what you want to do. I'll ask you to clarify anything I don't understand. When I'm clear, then I'll point you where you need to go to figure out how to do it.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top