R
Robert Nusz @ DPS
in using the following sample code, how do I define a field in a table for
the Yes/No switch, and set its value to a default value of yes.
Dim fld1 as Field
Dim fld2 as Field
Dim fld3 as Field
Dim fld4 as Field
Set fld1 = NewTbl.CreateField("CaseNo", dbInteger)
Set fld2 = NewTbl.CreateField("MyName", dbText, 50)
Set fld3 = NewTbl.CreateField("DatePaid", dbDate)
Set fld4 = NewTbl.CreateField("IsPaid", dbYesNo)
NewTbl.Fields.Append fld1
NewTbl.Fields.Append fld2
NewTbl.Fields.Append fld3
NewTbl.Fields.Append fld4
CurrentDb.TableDefs.Append NewTbl
where field 1 is named CaseNo and has an integer value default
field 2 is named MyName and has text value, length of 50 characters,
field 3 is named DatePaid and has date value (dbDate) with short date format,
and field 4
is named IsPaid, and is a switch field either yes or no value (checkmarked)
and defaults to No.
what dbxxxxx value do I use to define a yes/no field via code and how do I
set its default value to no.
Thanks in advance,
Robert
the Yes/No switch, and set its value to a default value of yes.
Dim fld1 as Field
Dim fld2 as Field
Dim fld3 as Field
Dim fld4 as Field
Set fld1 = NewTbl.CreateField("CaseNo", dbInteger)
Set fld2 = NewTbl.CreateField("MyName", dbText, 50)
Set fld3 = NewTbl.CreateField("DatePaid", dbDate)
Set fld4 = NewTbl.CreateField("IsPaid", dbYesNo)
NewTbl.Fields.Append fld1
NewTbl.Fields.Append fld2
NewTbl.Fields.Append fld3
NewTbl.Fields.Append fld4
CurrentDb.TableDefs.Append NewTbl
where field 1 is named CaseNo and has an integer value default
field 2 is named MyName and has text value, length of 50 characters,
field 3 is named DatePaid and has date value (dbDate) with short date format,
and field 4
is named IsPaid, and is a switch field either yes or no value (checkmarked)
and defaults to No.
what dbxxxxx value do I use to define a yes/no field via code and how do I
set its default value to no.
Thanks in advance,
Robert