Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

problem .. please help

$
0
0
iam working on a project

i have this code
Code:

dbname = App.Path & "\hitech97.mdb"
Set db = OpenDatabase(dbname, OpenTable)

sq1 = "select* from products where product_id=" & Val(Text1)
Set rs1 = db.OpenRecordset(sq1)
If rs1.RecordCount = 0 Then
 
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" And Text4.Text <> "" And Text5.Text <> "" And Text6.Text <> "" And Text8.Text <> "" And Text9.Text <> "" And Text10.Text <> "" And Text11.Text <> "" Then

If IsNumeric(Text1.Text) Then

Set rs = db.OpenRecordset("products")
With rs
.AddNew
!product_id = Text1
!Name = Text2
!genre = Text3
!brand = Text4
!made_in = Text5
!shipping_price = Text8
!price = Text9
!import_date = CDate(Text10.Text)
!release_date = CDate(Text6.Text)
!quantity = Text11

.Update
.Close
MsgBox (" add is done ")
Text1 = " ": Text2 = " ": Text3 = " ": Text4 = " ": Text5 = " ": Text6 = " ": Text8 = " ": Text9 = " ": Text10 = " ": Text11 = " "
End With
Else: MsgBox ("must product_id have to be a number ")
End If
Else: MsgBox (" one or more is empty ")
End If
Else: MsgBox ("product already exits ")
End If
End Sub

when i run .. and fill the text box and run the program .. i get run-time error 3464
data type mismatch in criteria expression ! ?
what's wrong ..

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>