I'm trying reference a field in a Table. I think the problem is this...
!Active.Value
I'm not sure if this is the way to refernce the field.
The field is Active in the SecurityDetails Table.
If Active is -1 then Ctl is -1
If Active is 0 then Ctl is 0
Ctl is a CheckBox.
Thanks
DS
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM SecurityDetails WHERE SecurityDetails.SecurityID = " & Me.TxtID & "", dbOpenDynaset)
With rst
If .EOF = False And .BOF = False Then
Dim Ctl As Control
For Each Ctl In Me.Controls
If Ctl.Tag = "9" Then
If !Active.Value = -1 Then
Ctl = -1
ElseIf !Active.Value = 0 Then
Ctl = 0
End If
End If
Next Ctl
End If
End With
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing
!Active.Value
I'm not sure if this is the way to refernce the field.
The field is Active in the SecurityDetails Table.
If Active is -1 then Ctl is -1
If Active is 0 then Ctl is 0
Ctl is a CheckBox.
Thanks
DS
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM SecurityDetails WHERE SecurityDetails.SecurityID = " & Me.TxtID & "", dbOpenDynaset)
With rst
If .EOF = False And .BOF = False Then
Dim Ctl As Control
For Each Ctl In Me.Controls
If Ctl.Tag = "9" Then
If !Active.Value = -1 Then
Ctl = -1
ElseIf !Active.Value = 0 Then
Ctl = 0
End If
End If
Next Ctl
End If
End With
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing