stephenlecompte
07-06-2004, 09:42 AM
I have the following code to add some fields in an access database:
Private Sub Form_Load()
Dim db As Database
Set db = OpenDatabase("C:\ZZZ OPERATIONS PROGRAMS\orderentry_be.mdb", False, False)
Dim tdf As TableDef
Set tdf = db.TableDefs("tblOrders")
With tdf
.Fields.Append .CreateField("fUnpk", dbBoolean)
.Fields.Append .CreateField("fDebr", dbBoolean)
.Fields.Append .CreateField("fG11", dbBoolean)
End With
MsgBox "Updating done on database... "
Unload Me
End Sub
This has worked before but now when I try to add the above fields they show up with a 0 in the field instead of the normal check box. Not sure as to why this is happening? Any suggestions much appreciated.
Private Sub Form_Load()
Dim db As Database
Set db = OpenDatabase("C:\ZZZ OPERATIONS PROGRAMS\orderentry_be.mdb", False, False)
Dim tdf As TableDef
Set tdf = db.TableDefs("tblOrders")
With tdf
.Fields.Append .CreateField("fUnpk", dbBoolean)
.Fields.Append .CreateField("fDebr", dbBoolean)
.Fields.Append .CreateField("fG11", dbBoolean)
End With
MsgBox "Updating done on database... "
Unload Me
End Sub
This has worked before but now when I try to add the above fields they show up with a 0 in the field instead of the normal check box. Not sure as to why this is happening? Any suggestions much appreciated.