| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1662 人关注过本帖
标题:[求助]如果设置日期控件DTPicker1的value属性为空?
只看楼主 加入收藏
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
结帖率:78.95%
收藏
 问题点数:0 回复次数:2 
[求助]如果设置日期控件DTPicker1的value属性为空?
如果设置日期控件DTPicker1的value属性为空?
我设置时提示value属性不能为空...但实际运用时会有空的日期...那要怎么做?
谢谢
搜索更多相关主题的帖子: value属性 日期控件 时会 
2007-01-16 20:06
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
收藏
得分:0 

问题解决...我在网上找到了方法..
窗体截入时DTPicker1不显示时间
Private Sub Form_Load()
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = " "
End Sub

'用户选择时DTPicker1显示时间
Private Sub DTPicker1_Change()
DTPicker1.Format = dtpLongDate
End Sub

'双击清除DTPicker1中显示的时间
Private Sub DTPicker1_DblClick()
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = " "
End Sub


/images/2011/147787/2011051411021524.jpg" border="0" />
2007-01-16 21:17
yansfy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-3-17
收藏
得分:0 
select 语法错误
请问务位大侠,错在哪里,多谢!
Private Sub selcmd1_Click()
  Dim str As String
  str = ""
  If Trim(Text1.Text) <> "" Then
    If str = "" Then
      str = "姓名='" + Trim(Text1.Text) + "'"
    Else
      str = str + "and 姓名='" + Trim(Text1.Text) + "'"
    End If
  End If
  If Trim(DataCombo1.Text) <> "" Then
    If str = "" Then
      str = "所属系部='" + Trim(DataCombo1.Text) + "'"
    Else
      str = str + "and 所属系部='" + Trim(DataCombo1.Text) + "'"
    End If
  End If
  If Trim(DataCombo2.Text) <> "" Then
    If str = "" Then
      str = "职称='" + Trim(DataCombo2.Text) + "'"
    Else
      str = str + "and 职称='" + Trim(DataCombo2.Text) + "'"
    End If
  End If
  If Trim(DataCombo3.Text) <> "" Then
    If str = "" Then
      str = "课题级别='" + Trim(DataCombo3.Text) + "'"
    Else
      str = str + "and 课题级别='" + Trim(DataCombo3.Text) + "'"
    End If
  End If
  If Trim(Text2.Text) <> "" Then
      If str = "" Then
        str = "课题题目='" + Trim(Text2.Text) + "'"
      Else
        str = str + "and 课题题目='" + Trim(Text2.Text) + "'"
      End If
  End If
  If Trim(DataCombo3.Text) <> "" Then
    If str = "" Then
      str = "奖励级别='" + Trim(DataCombo3.Text) + "'"
    Else
      str = str + "and 奖励级别='" + Trim(DataCombo3.Text) + "'"
    End If
  End If
  If str <> "" Then
    If DTPicker1.Value = DTPicker2.Value Then
      Adodc1.RecordSource = "select * from jiaoyanjiaogaiketi where " + str
      Adodc1.Refresh
    Else
      Adodc1.RecordSource = "select * from jiaoyanjiaogaiketi where " + str + "and 开题时间 between '" & CDate(DTPicker1.Value) & "'and '" & CDate(DTPicker2.Value) & "'"
      Adodc1.Refresh
    End If
  Else
    Adodc1.RecordSource = "select * from jiaoyanjiaogaiketi"
    Adodc1.Refresh
  End If
  recs = Adodc1.Recordset.RecordCount
  If recs = 0 Then
    MsgBox "没有任何满足条件的记录", vbOKOnly, "信息提示"
  End If
  Call encomm
End Sub
2008-03-17 15:28
快速回复:[求助]如果设置日期控件DTPicker1的value属性为空?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.056538 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved