Hi All,
My requirement is how to set constraint to Sub_Modules column
On Error GoTo addfielderror
If txtmodule.Text = "" Then
MsgBox "Please Insert Module Name", vbInformation, "Adding"
txtmodule.SetFocus
Else
d = FLUpper(txtmodule.Text)
que = "Insert into Modules" & "(Modules)" & " Values (" & "'" & d &
"'" & ")"
cn.Execute que
MsgBox "Record " & d & " Added to Modules.", vbInformation, "Adding"
If vbOK = 1 Then
txtmodule.Text = ""
txtmodule.SetFocus
End If
End If
Set db = OpenDatabase("D:\VSS_WKF\SCM-VB\check\DB\scmregister.mdb")
Set tdf = db.CreateTableDef(d)
With tdf
.Fields.Append .CreateField("Sub_Modules")
db.TableDefs.Append tdf
Exit Sub
End With
addfielderror:
If Err Then
MsgBox "Module " & FLUpper(d) & " Alrady Exists", vbInformation, "Adding"
If vbOK = 1 Then
txtmodule.Text = ""
txtmodule.SetFocus
Exit Sub
ElseIf Err.Number = 3010 Then
MsgBox "Table Already Exists", vbOKOnly, "Table"
Else
MsgBox "Table " & d & " created."
End If
End If
Note: - FLUpper is my function
Pls help to solve
TIA
Archived from group: microsoft>public>vb>directx