佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 827|回复: 1

VB 问题

[复制链接]
发表于 18-4-2006 01:23 AM | 显示全部楼层 |阅读模式
Private Sub btnadd_Click()
If vcdid.Text = "" Then
MsgBox "Please enter vcd id", vbInformation, "VCD/DVD Cataloguing System"
vcdid.SetFocus

Else
If vcdtitle.Text = "" Then
MsgBox "Please enter vcd title", vbInformation, "VCD/DVD Cataloguing System"
vcdtitle.SetFocus
Else
If castid.Text = "" Then
MsgBox "Please enter cast id", vbInformation, "VCD/DVD Cataloguing System"
castid.SetFocus
Else
If datepurchase.Text = "" Then
MsgBox "Please enter date purchase", vbInformation, "VCD/DVD Cataloguing System"
datepurchase.SetFocus
Else
If movid.Text = "" Then
MsgBox "Please enter movie id", vbInformation, "VCD/DVD Cataloguing System"
movid.SetFocus
Else
If episode.Text = "" Then
MsgBox "Please enter episode", vbInformation, "VCD/DVD Cataloguing System"
episode.SetFocus
Else
If rtime.Text = "" Then
MsgBox "Please enter running time", vbInformation, "VCD/DVD Cataloguing System"
rtime.SetFocus
Else
If rating.Text = "" Then
MsgBox "Please enter rating", vbInformation, "VCD/DVD Cataloguing System"
rating.SetFocus
Else
If catagoriesmovie.Text = "" Then
MsgBox "Please enter catagories movie", vbInformation, "VCD/DVD Cataloguing System"
catagoriesmovie.SetFocus
Else
If moviename.Text = "" Then
MsgBox "Please enter movie name", vbInformation, "VCD/DVD Cataloguing System"
moviename.SetFocus
Else
If movietype.Text = "" Then
MsgBox "Please enter movie type", vbInformation, "VCD/DVD Cataloguing System"
movietype.SetFocus
Else
If vcdsyn.Text = "" Then
MsgBox "Please enter vcd Synopsis", vbInformation, "VCD/DVD Cataloguing System"
vcdsyn.SetFocus
Else
If season.Text = "" Then
MsgBox "Please enter season", vbInformation, "VCD/DVD Cataloguing System"
season.SetFocus
Else
If vcdtype.Text = "" Then
MsgBox "Please enter vcd type", vbInformation, "VCD/DVD Cataloguing System"
vcdtype.SetFocus
Else
If catagory.Text = "" Then
MsgBox "Please enter catagory", vbInformation, "VCD/DVD Cataloguing System"
catagory.SetFocus
Else
If price.Text = "" Then
MsgBox "Please enter price", vbInformation, "VCD/DVD Cataloguing System"
price.SetFocus
Else
If catagoryv.Text = "" Then
MsgBox "Please enter catagory version", vbInformation, "VCD/DVD Cataloguing System"
catagoryv.SetFocus
Else
If catagoryname.Text = "" Then
MsgBox "Please enter catagoryname", vbInformation, "VCD/DVD Cataloguing System"
catagoryname.SetFocus
Else
If castlabel.Text = "" Then
MsgBox "Please enter cast label", vbInformation, "VCD/DVD Cataloguing System"
castlabel.SetFocus
Else
If director.Text = "" Then
MsgBox "Please enter director", vbInformation, "VCD/DVD Cataloguing System"
director.SetFocus
Else
If releasedate.Text = "" Then
MsgBox "Please enter release date", vbInformation, "VCD/DVD Cataloguing System"
releasedate.SetFocus
Else
rsIn.AddNew
rsIn.Fields("vcd_id") = vcdid.Text
rsIn.Fields("vcd_title") = vcdtitle.Text
rsIn.Fields("cast_id") = castid.Text
rsIn.Fields("data_purchase") = datepurchase.Text
rsIn.Fields("movie_id") = movid.Text
rsIn.Fields("vcd_synopsis") = vcdsyn.Text
rsIn.Fields("season_id") = season.Text
rsIn.Fields("vcd_type") = vcdtype.Text
rsIn.Fields("catagories_id") = catagory.Text
rsIn.Fields("price") = price.Text
rsIn.Fields("episode") = episode.Text
rsIn.Fields("running_time") = rtime.Text
rsIn.Fields("catagories_version") = catagoryv.Text
rsIn.Fields("vcd_catogories_name") = catagoryname.Text
rsIn.Fields("movie_name") = moviename.Text
rsIn.Fields("movie_type") = movietype.Text
rsIn.Fields("cast_label") = castlabel.Text
rsIn.Fields("director") = director.Text
rsIn.Fields("release_date") = releasedate.Text

rsIn.Update

MsgBox ("Data added."), "VCD/DVD Cataloguing System"
Exit Sub
Data1.Recordset.MoveNext

End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If





End Sub

error message : object variable or with block variable not set

是什么意思?
恳求大大帮助~~~
回复

使用道具 举报


ADVERTISEMENT

发表于 18-4-2006 09:16 AM | 显示全部楼层
你的 code 很糟糕, 建议你改一改, 如果一个人什么都没填, 那么不是会 pop 出多个 message box? 何不在一个 message box 写出全部的错处? 另外你的 Exit Sub 的地方也怪怪的.

另外, 这 error message 的意思是说, 你其中一个 field 的名字错了, 或有 object 没有 declare, 可能是 rsIn, 或 Data1.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 14-11-2024 06:03 PM , Processed in 0.137425 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表