非連結フォームで、エラー表示させたくないときのものだったかも
'*** セクション内コントロールから0件のレコードセット作成
Public Function EmptyRs(SrcSection As Section) As ADODB.Recordset
On Error GoTo ErrLabel
Dim ctr As Control
Dim rs As New ADODB.Recordset
For Each ctr In SrcSection.Controls
rs.Fields.Append ctr.ControlSource, adVarChar, 1
Next
rs.Open
If rs.Fields.Count > 0 Then
Set EmptyRs = rs
Else
Set EmptyRs = Nothing
End If
Set rs = Nothing
Exit Function
ErrLabel:
If Err.Number = 438 Then Resume Next
End Function
0 件のコメント:
コメントを投稿