关于数据集

anxl 2003-09-29 05:20:11
窗体有数据集一个有若干字段,其中“开始时间”+“影片时长”=“归还时间”
如何作可以让程序自动判断,如果系统(归还时间)时间>“归还时间”则字体通过定义的格式如色彩高亮标记出来!不知可不可以实现?
...全文
32 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
anxl 2003-09-30
  • 打赏
  • 举报
回复
请教这样写对吗?
Private Sub Command2_Click()
Dim tempstr As String
Dim zwh As Integer
Dim adoRS As New ADODB.Recordset
Dim tempsql As String
Dim bh As String
Dim name As String
Dim start_time As Date
Dim end_time As Date
Dim stunum As String
Dim date_in As Date
Dim notice As String

st:
tempstr = InputBox("请输入座位号:", "资料归还")
If tempstr = "" Then Exit Sub
zwh = CInt(tempstr)
If zwh < 0 Or zwh > 100 Then
MsgBox "请输入正确的座位号!"
GoTo st
End If


tempsql = "select * from borrow where zwh =" & zwh
adoRS.Open tempsql, db, adOpenStatic, adLockOptimistic
If adoRS.EOF Then
MsgBox "没有这个座位号!请重试!"
adoRS.Close
GoTo st
End If

bh = adoRS("zlno")
name = adoRS("zlmc")
stunum = adoRS("stunum")
start_time = adoRS("start_time")
end_time = Time
date_in = Date
adoRS.Close
notice = "请收回资料编号为:" + bh + " 片名为:" + name + " 的录像带"
Dim res
res = MsgBox(notice, vbOKCancel, "请注意")
If res <> vbOK Then
Exit Sub
End If

tempsql = "delete * from borrow where zwh =" & zwh
adoRS.Open tempsql, db, adOpenStatic, adLockOptimistic

tempsql = "update lxzlt set counts = counts + 1 where zlno ='" & bh & "'"
adoRS.Open tempsql, db, adOpenStatic, adLockOptimistic

If DateAdd("n", 20, start_time) < Time Then
tempsql = "insert into bak(zlno,zlmc,zwh,stunum,start_time,end_time,date_in) values('" & bh & "','" & name & "','" & zwh & "','" & stunum & "','" & start_time & "','" & end_time & "','" & date_in & "')"
adoRS.Open tempsql, db, adOpenStatic, adLockOptimistic
End If
jishu = jishu - 1
Label1.Caption = "当前借阅总人数:" & CStr(jishu)
Set grdDataGrid.DataSource = Nothing
adoPrimaryRS.Requery
Set grdDataGrid.DataSource = adoPrimaryRS
sizegrid
If Time() > end_time Then
grdDataGrid.Caption = "guihuanle"
grdDataGrid

.Color = vbRed
End If

GoTo st
End Sub
silverblade 2003-09-29
  • 打赏
  • 举报
回复
if date()>rs("开始时间)+rs("影片时长") then
label.caption="***"
label.color=vbred
end if
anxl 2003-09-29
  • 打赏
  • 举报
回复
“系统(归还时间)时间”我只的是当前系统时间或是“归还时间”也就是说如果超出归还时间的话?则高亮标记。
wushuo 2003-09-29
  • 打赏
  • 举报
回复
首先读取一个记录的该3个字段
if 系统(归还时间)时间>“归还时间”then
label.caption="***"
label.color=vbred
end if
anxl 2003-09-29
  • 打赏
  • 举报
回复
谢谢具体解释以下,非常诚恳的请求谢谢!
busisoft 2003-09-29
  • 打赏
  • 举报
回复
当然可以容易实现

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧