|
5#
楼主 |
发表于 2011-7-16 11:10:25
|
只看该作者
todaynew 发表于 2011-7-15 15:19
筛选即可
回版主:
筛选怎么做呢?
我再说具体一点:
主窗体字段A,在cmdSave单击事件如下:
If IsNull(Me.A) Then
Call AutoShid
rs.Open "tblAAA", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With rs
.AddNew
![号码] = Me.A
.Update
End With
rs.Close
Set rs = Nothing
DoCmd.SetWarnings False
DoCmd.RunSQL "insert into tblBBB SELECT tblBBBtemp.* FROM tblBBBtemp;"
DoCmd.SetWarnings True
End If
------------------------------------------------------------------------------------------------------------------------------
Private Sub AutoShid()
Dim ID, date2 As String
date2 = "SKZD" & Format(Me.日期, "YYYYMMDD")
ID = DMax("[A]", "[tblAAA]", "[A] like '" & date2 & "???'")
If IsNull(ID) Then
Me.A = date2 & "001"
Else
Me.A = date2 & Format(CStr(Right(ID, 3) + 1), "000")
End If
End Sub
------------------------------------------------------------------------------------------------------------------------------
如上,在主窗体字段A有值后,子窗体(有若干条记录的数据表,但第一个字段"B"是空的)里每行字段B都变成和主窗体字段A相同的值。
请问这个是要怎么实现呢?
|
|