M
Maracay
Hi Guys,
I have a continuous form, I am using Set rs = Me.RecordsetClone, and is
great because now the data is not going to my continuous form, but is still
passing thru the fields I have on the header of the form, there is any way to
avoid this.
The other thing is that I want to know if I am using the rs.edit and
rs.update in the right way, in this way works but, I just want to have
another opinion.
This is my code:
Private Sub Command20_Click()
On Error GoTo Err_handler
Dim rs As Recordset
Set rs = Me.RecordsetClone
'Set rs = Recordset
Forms!frmImpData!ID.Width = 1400
rs.MoveFirst
If IsNull(Me.Expre1) And Forms!frmMasterData!txtProcess3 = True Then
MsgBox ("Expresion 1 needs to be included to process the file")
Exit Sub
End If
If IsNull(Me.Expre2) And Forms!frmMasterData!txtProcess4 = True Then
MsgBox ("Expresion 2 needs to be included to process the file")
Exit Sub
End If
Do Until rs.EOF
If Forms!frmMasterData!txtProcess1 = True And Not IsNull(rs!Suite.Value) Then
rs.Edit
rs!Suite = "Suite " + rs!Suite
rs.Update
End If
AddedExpre1 = Null
If Forms!frmMasterData!txtProcess3 = True Then
rs.Edit
rs!AddedExpre1 = Expre1
rs.Update
End If
AddedExpre2 = Null
If Forms!frmMasterData!txtProcess4 = True Then
rs.Edit
rs!AddedExpre2 = Expre2
rs.Update
End If
If Forms!frmMasterData!txtProcess40 = True Then
If rs!Country = "Canada" Then
rs.Edit
rs!Country = " "
rs.Update
End If
End If
rs.MoveNext
Loop
MsgBox "Date was Processed"
sExit:
Set rst = Nothing
Me.Requery
Exit Sub
Err_handler:
MsgBox Err.Description
Resume sExit
End Sub
I have a continuous form, I am using Set rs = Me.RecordsetClone, and is
great because now the data is not going to my continuous form, but is still
passing thru the fields I have on the header of the form, there is any way to
avoid this.
The other thing is that I want to know if I am using the rs.edit and
rs.update in the right way, in this way works but, I just want to have
another opinion.
This is my code:
Private Sub Command20_Click()
On Error GoTo Err_handler
Dim rs As Recordset
Set rs = Me.RecordsetClone
'Set rs = Recordset
Forms!frmImpData!ID.Width = 1400
rs.MoveFirst
If IsNull(Me.Expre1) And Forms!frmMasterData!txtProcess3 = True Then
MsgBox ("Expresion 1 needs to be included to process the file")
Exit Sub
End If
If IsNull(Me.Expre2) And Forms!frmMasterData!txtProcess4 = True Then
MsgBox ("Expresion 2 needs to be included to process the file")
Exit Sub
End If
Do Until rs.EOF
If Forms!frmMasterData!txtProcess1 = True And Not IsNull(rs!Suite.Value) Then
rs.Edit
rs!Suite = "Suite " + rs!Suite
rs.Update
End If
AddedExpre1 = Null
If Forms!frmMasterData!txtProcess3 = True Then
rs.Edit
rs!AddedExpre1 = Expre1
rs.Update
End If
AddedExpre2 = Null
If Forms!frmMasterData!txtProcess4 = True Then
rs.Edit
rs!AddedExpre2 = Expre2
rs.Update
End If
If Forms!frmMasterData!txtProcess40 = True Then
If rs!Country = "Canada" Then
rs.Edit
rs!Country = " "
rs.Update
End If
End If
rs.MoveNext
Loop
MsgBox "Date was Processed"
sExit:
Set rst = Nothing
Me.Requery
Exit Sub
Err_handler:
MsgBox Err.Description
Resume sExit
End Sub