Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

编码错在哪里

qiecaiban  发表于:2015-12-16 11:25:02  
复制


書籍編号 書名 類別ID 作者 出版社ID 単価 進書日期
25 电脑新时代-6光盘 2 UNKNOWN 1 5 2002/07/08
21 VISUALBASIC5.0教程 3 SteveBrown 2 28 2001/09/28
22 CHIP-01-08 1 电子计算机与外部设备期刊社 3 16.8 2001/09/28
28 CHIP-02-07光盘 2 电子计算机与外部设备杂志社 3 5 2002/07/13









想用代码做一个查询

書名里面输入文字  点击查询就从子窗口里面调出来。


我自己照网上学编得程序是

Private Sub コマンド4_Click()
   On Error GoTo Err_コマンド4_Click

 Dim strWhere As String
  strWhere = ""
  If Not IsNull(Me.書名) Then
    strWhere = strWhere & "([書名] like '" & Me.書名 & "' )AND "
  End If


 Me.A.Form.Filter = strWhere
  Me.A.Form.FilterOn = True

Exit_コマンド3_Click:
  Exit Sub
  
Err_コマンド3_Click:
    MsgBox Err.Description
    Resume Exit_コマンド3_Click
End Sub

可是调不出来

请问程序错在哪里

正确的该怎么写



 

Top
zhaoyoulong 发表于:2015-12-16 12:03:26

 Dim strWhere As String
  
  If Not IsNull(Me.書名) Then strWhere = "[書名] like '*" & Me.書名 & "*' "
    




qiecaiban 发表于:2015-12-16 12:29:37

谢谢你的回复 我照你说的做了


Private Sub コマンド4_Click()

   On Error GoTo Err_コマンド4_Click


  Dim strWhere As String
   
  If Not IsNull(Me.書名)
  Then strWhere = "[書名]like'*"&Me.書名 & "*' "
  End If


 Me.A.Form.Filter = strWhere
  Me.A.Form.FilterOn = True


Exit_コマンド3_Click:
  Exit Sub
  
Err_コマンド3_Click:
    MsgBox Err.Description
    Resume Exit_コマンド3_Click

End Sub


还是不行噢 而且这两行还变成了红色



qiecaiban 发表于:2015-12-16 12:30:04
Private Sub コマンド4_Click()
   On Error GoTo Err_コマンド4_Click


  Dim strWhere As String
   
  If Not IsNull(Me.書名)
  Then strWhere = "[書名]like'*"&Me.書名 & "*' "
  End If


 Me.A.Form.Filter = strWhere
  Me.A.Form.FilterOn = True


Exit_コマンド3_Click:
  Exit Sub
  
Err_コマンド3_Click:
    MsgBox Err.Description
    Resume Exit_コマンド3_Click
End Sub


qiecaiban 发表于:2015-12-16 12:46:00

大神你好

我找下面的做了

出来了


谢谢


Private Sub コマンド2_Click()


  Dim strWhere As String
  strWhere = ""
 
   
  If Not IsNull(Me.書名) Then
    strWhere = "[書名] like '*" & Me.書名 & "*'"
  End If


   Me.A.Form.Filter = strWhere
   Me.A.Form.FilterOn = True


End Sub



总记录:4篇  页次:1/1 9 1 :