S
SAC
I have two forms that are similar and they have the same conditional
formatting set for the same controls. Form 1 shows all the records and form
2 only shows info for the current record.
They both have conditional formatting set the same for the some controls.
Form 2's conditional formating does not work.
I'm using recordset clone as it's data source and I'm opening it with a
command button and synchronizing it with the following code:
If IsNull(Me![txtXCPO]) Then
Exit Sub
End If
Dim formname As String, SyncCriteria As String
Dim frm As Form, rs As DAO.Recordset
Dim strSQL As String
'Set the formname to "frmOrderStatusDatesSF," the form that will be
'synchronized.
formname = "frmOrderStatusDatesSF"
'Check to see if the form is open. If it is not open, open it.
If Not SysCmd(acSysCmdGetObjectState, acForm, formname) Then
DoCmd.OpenForm formname
End If
varTemp = SysCmd(acSysCmdGetObjectState, acForm, formname)
'Define the form object and Recordset object for the form.
Set frm = Forms(formname)
Set rs = frm.RecordsetClone
strSQL = "[PORD] = " & Me!txtPORD & " AND [PLINE] = " & Me!txtPLINE
'Synchronize the corresponding record in the form to the current record
in the subform.
rs.FindFirst strSQL
'If a record exists in the form, find the matching record.
If rs.NoMatch Then
MsgBox "No match exists!", 64, formname
Else
frm.Bookmark = rs.Bookmark
End If
Exit_Command52_Click:
Exit Sub
Err_Command52_Click:
MsgBox Err.Description
Resume Exit_Command52_Click
End Sub
Don't understand why the conditional formatting is not working on this form.
Any ideas?
Thanks.
formatting set for the same controls. Form 1 shows all the records and form
2 only shows info for the current record.
They both have conditional formatting set the same for the some controls.
Form 2's conditional formating does not work.
I'm using recordset clone as it's data source and I'm opening it with a
command button and synchronizing it with the following code:
If IsNull(Me![txtXCPO]) Then
Exit Sub
End If
Dim formname As String, SyncCriteria As String
Dim frm As Form, rs As DAO.Recordset
Dim strSQL As String
'Set the formname to "frmOrderStatusDatesSF," the form that will be
'synchronized.
formname = "frmOrderStatusDatesSF"
'Check to see if the form is open. If it is not open, open it.
If Not SysCmd(acSysCmdGetObjectState, acForm, formname) Then
DoCmd.OpenForm formname
End If
varTemp = SysCmd(acSysCmdGetObjectState, acForm, formname)
'Define the form object and Recordset object for the form.
Set frm = Forms(formname)
Set rs = frm.RecordsetClone
strSQL = "[PORD] = " & Me!txtPORD & " AND [PLINE] = " & Me!txtPLINE
'Synchronize the corresponding record in the form to the current record
in the subform.
rs.FindFirst strSQL
'If a record exists in the form, find the matching record.
If rs.NoMatch Then
MsgBox "No match exists!", 64, formname
Else
frm.Bookmark = rs.Bookmark
End If
Exit_Command52_Click:
Exit Sub
Err_Command52_Click:
MsgBox Err.Description
Resume Exit_Command52_Click
End Sub
Don't understand why the conditional formatting is not working on this form.
Any ideas?
Thanks.