|
本帖最后由 todaynew 于 2011-3-25 11:15 编辑
runkingamw 发表于 2011-3-25 10:45
请问我应该怎样才能判断在 销售情况 表内是否有该相应的记录
如果有就加载到窗体
如果没有或多于一个就提 ...
Dim StrTemp As String
Dim rs As New ADODB.Recordset
StrTemp = "Select * From 销售情况 Where 房号ID=" & Me.房号ID
rs.Open StrTemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs.RecordCount = 1 Then
Me![合同成交价] = rs("合同成交价")
Me![业主姓名1] = rs("业主姓名1")
Me![业主姓名2] = rs("业主姓名2")
Me![业主姓名1] = rs("业主姓名1")
Me![业主身份证1] = rs("业主身份证1")
Me![业主身份证2] = rs("业主身份证2")
Me![落定日期] = rs("落定日期")
Me![合同签订日期] = rs("合同签订日期")
Me![联系电话] = rs("联系电话")
Me![按揭银行] = rs("按揭银行")
Me![备注] = rs("备注")
Me![销售人员ID] = rs("销售人员ID")
Me![按揭金额] = rs("按揭金额")
Else
MsgBox "记录不存在或大于1!"
End If
rs.Close
Set rs = noting |
|