I have a drawing database. Table1 contents:
DWGID Number, Primary Key
Ex Text, 3 char
DwgNo Text, 9 char
Rev Text, 2 char
Title Text, 255 char
Format Text, 3 char
Deleted Yes/No
Comments Memo
Table 2 contents:
DWGID Number, Link to tblDwg
UOID Number, Index
Used Text, 9 char
UDeleted Yes/No
Main Form has Table1 fields. The issue I have is that when the CheckBox Deleted is Checked (Change State), I need to have the program search through Table2 and Change UDelete to the same state (either Checked or Not Checked).
UDelete is used in a subreport to change the text color of the Used field if a specific drawing is deleted. This flags engineers that a change to a drawing is needed.
My code is as follows:
frmDWg
-----*-----
-----*-----
Module - Public
-----*-----
When I actually click on Deleted, I get the following error:
Run-Time Error '3251': Operation is not supported for this type of object.
When I click debug, the line of code highlighted is:
rsUsed.Index = "UOID"
UOID is the primary index (No Duplicates) in tblUsedOn.
I do not understand what the issue is....
DWGID Number, Primary Key
Ex Text, 3 char
DwgNo Text, 9 char
Rev Text, 2 char
Title Text, 255 char
Format Text, 3 char
Deleted Yes/No
Comments Memo
Table 2 contents:
DWGID Number, Link to tblDwg
UOID Number, Index
Used Text, 9 char
UDeleted Yes/No
Main Form has Table1 fields. The issue I have is that when the CheckBox Deleted is Checked (Change State), I need to have the program search through Table2 and Change UDelete to the same state (either Checked or Not Checked).
UDelete is used in a subreport to change the text color of the Used field if a specific drawing is deleted. This flags engineers that a change to a drawing is needed.
My code is as follows:
frmDWg
-----*-----
Code:
Option Explicit
Private Sub Deleted_AfterUpdate()
'When this Box checked, uncheck ReqUpdt, Updated and NoChange
If Deleted = "-1" Then
Ex.ForeColor = "255"
DwgNo.ForeColor = "255"
Rev.ForeColor = "255"
Title.ForeColor = "255"
Format.ForeColor = "255"
ElseIf Deleted = "0" Then
If Not IsNull(Format) Then
Ex.ForeColor = "16711680"
DwgNo.ForeColor = "16711680"
Rev.ForeColor = "16711680"
Title.ForeColor = "16711680"
Format.ForeColor = "16711680"
Else
Ex.ForeColor = "0"
DwgNo.ForeColor = "0"
Rev.ForeColor = "0"
Title.ForeColor = "0"
Format.ForeColor = "0"
End If
End If
DwgTemp = DwgNo
DelTemp = Deleted
CheckDeleted
DwgTemp = ""
DelTemp = ""
End Sub
-----*-----
Module - Public
Code:
Option Explicit
-----
Public DwgTemp As String
Public DelTemp As Variant
-----
Public Function CheckDeleted()
'When frmDwg.Deleted is checked, go to tblUsed and set UDeleted to same state as Deleted for same Dwg
Dim dbsDoc As Object
Dim rsUsed As Variant
Set dbsDoc = CurrentDb
Set rsUsed = dbsDoc.OpenRecordset("tblUsedOn")
rsUsed.Index = "UOID"
rsUsed.Seek "=", DwgTemp
If Not rsUsed.NoMatch Then
rsUsed.UDeleted = DelTemp
End If
rsUsed.Close
Set rsUsed = Nothing
End Function
When I actually click on Deleted, I get the following error:
Run-Time Error '3251': Operation is not supported for this type of object.
When I click debug, the line of code highlighted is:
rsUsed.Index = "UOID"
UOID is the primary index (No Duplicates) in tblUsedOn.
I do not understand what the issue is....