#2
梦幻倩影2016-11-26 13:47
|
Option Explicit
Dim sqlstr As String
Private Sub Command1_Click()
Call PP
= adCmdText //这部分错误
Adodc1.RecordSource = sqlstr //等号附近有错误
Adodc1.Refresh
Adodc2.Refresh
With Adodc2.Recordset
.AddNew
Adodc2.Recordset.Fields("Carno") = Trim(Adodc1.Recordset.Fields("Carno"))//这部分希望实现adodc1部分连接的记录源中Carno的数据传递到adocdc2中的Car,怎么实现
Adodc2.Recordset.Fields("Carin") = Trim(Text2.Text)
Adodc2.Recordset.Fields("Carout") = Trim(Text3.Text)
Adodc2.Recordset.Fields("Alltime") = Trim(Text4)
Adodc2.Recordset.Fields("Money") = Trim(Text5)
Adodc2.Recordset.Update
End With
Unload Me
Form9.Show
S = S - 1
End Sub
Private Sub Command2_Click()
Form9.Show
End Sub
Private Sub DataCombo1_Click(Area As Integer)
Text2.Text = DataCombo1.BoundText
Text4.Text = DateDiff("n", CDate(Text2.Text), CDate(Text3.Text))
Text5.Text = Format(Val(Text4.Text / 60) * 2, "0.00")
End Sub
Private Sub Form_Load()
Text3.Text = Now()
End Sub
Private Sub PP()
If Trim(Text2.Text) <> "" Then
sqlstr = " select * from tingchejilu2 Carin='" & Trim(Text2) & "'"
End If
End Sub