G
Guest
Hi:
I have the following codes in my command button in a Main Form. When
cmdbutton is click, nothing happens. It works when the subform is navigated
first before clicking the cmdbutton. I tried to insert a "setfocus" command
before the "rst.MoveFirst", it works but on the second click. Any idea.
Thansk
Private Sub cmdSendEmail_Click()
Dim rst As DAO.Recordset
Dim frm As Form
Dim i As Integer
Set rst = Me![frmAssignment].Form.Recordset
Set frm = Form_frmAssignment
MyNum = rst.RecordCount
rst.MoveFirst
Do While MyNum <> frm.CurrentRecord
For i = 1 To MyNum
MsgBox "Sending E-mail"
rst.MoveNext
Next
Loop
End Sub
I have the following codes in my command button in a Main Form. When
cmdbutton is click, nothing happens. It works when the subform is navigated
first before clicking the cmdbutton. I tried to insert a "setfocus" command
before the "rst.MoveFirst", it works but on the second click. Any idea.
Thansk
Private Sub cmdSendEmail_Click()
Dim rst As DAO.Recordset
Dim frm As Form
Dim i As Integer
Set rst = Me![frmAssignment].Form.Recordset
Set frm = Form_frmAssignment
MyNum = rst.RecordCount
rst.MoveFirst
Do While MyNum <> frm.CurrentRecord
For i = 1 To MyNum
MsgBox "Sending E-mail"
rst.MoveNext
Next
Loop
End Sub