J
Joseph
I am having a problem with this code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.CadetID) Or Me.CadetID = Null Then
Me.cmbCadetID.Visible = False
Me.lblCadetID.Visible = False
Me.cmbCadetSig.Visible = False
Me.lnCadetSig.Visible = False
Else
Me.cmbCadetID.Visible = True
Me.lblCadetID.Visible = True
Me.cmbCadetSig.Visible = True
Me.lnCadetSig.Visible = True
End If
If IsNull(Me.Doc) Or Me.Doc = 0 Then
Me.lnFacNurse.Visible = False
Me.FacNurse.Visible = False
Me.FacNursePosit.Visible = False
Else
Me.lnFacNurse.Visible = True
Me.FacNurse.Visible = True
Me.FacNursePosit.Visible = True
End If
End Sub
The error code:
Run-time Error :2427
You entered an expression that has no value.
The Data:
CREATE DATABASE IF NOT EXISTS Incidents;
USE Incidents;
DROP TABLE IF EXISTS `FacilityIncidents`;
CREATE TABLE `FacilityIncidents` (
`FacIncidId` int(10) NOT NULL auto_increment,
`StaffID` int(10) NOT NULL,
`CadetID` int(10) default NULL,
`DTG` datetime default NULL,
`Location` varchar(100) default NULL,
`Subject` varchar(255) default NULL,
`Description` longtext character set utf8,
`User` varchar(50) NOT NULL,
`Computer` varchar(50) NOT NULL,
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
`IncidTypeID` int(10) unsigned NOT NULL,
`Doc` tinyint(4) default '0',
PRIMARY KEY (`FacIncidId`),
KEY `FacIncdId` (`FacIncidId`),
KEY `StaffId` (`StaffID`),
KEY `StaffId1` (`CadetID`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO `FacilityIncidents`
(`FacIncidId`,`StaffID`,`CadetID`,`DTG`,`Location`,`Subject`,`Description`,`User`,`Computer`,`TimeStamp`,`IncidTypeID`,`Doc`) VALUES
(1,1,NULL,'2007-06-28 00:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(2,1,NULL,'2007-06-26 00:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(3,1,NULL,'2007-08-04 16:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(4,1,NULL,'2007-07-25 00:00:00','Control
Tower',NULL,’test','','','2009-10-23 16:40:46',0,0),
(5,1,NULL,'2007-09-27 00:00:00','Boot Camp Facility
Gate',NULL,’test.','','','2009-10-23 16:40:46',0,0),
(11,1,11,'2008-01-01
12:00:00','asdfasd','test','test','martinezjr','TRAININGNCO','2009-10-23
16:40:46',0,0),
(12,1,11,NULL,'TEST','TEST','TEST','MARTINEZJR','PLTSGT','2009-10-23
16:42:55',0,0),
(13,1,NULL,'2009-01-01
12:00:00','Test','asdfasdf','Testasdfasdfasdfasdfasdfasdf','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:40:46',0,0),
(14,1,58,'2009-01-01
12:12:00','Test','test','Testtesetsets','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:40:46',0,0),
(15,1,NULL,'2009-10-10
16:00:00','TEST','TEST','TEST','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:43:05',0,0);
The first part dealing with Me.CadetID works fine, but with the second part,
dealing with Me.Doc, that error keeps showing up. I have tried different ways
to that same statement using Nz(), Select Cases, !IsNull(), etc, but always
the same answer.
Please Help!!
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.CadetID) Or Me.CadetID = Null Then
Me.cmbCadetID.Visible = False
Me.lblCadetID.Visible = False
Me.cmbCadetSig.Visible = False
Me.lnCadetSig.Visible = False
Else
Me.cmbCadetID.Visible = True
Me.lblCadetID.Visible = True
Me.cmbCadetSig.Visible = True
Me.lnCadetSig.Visible = True
End If
If IsNull(Me.Doc) Or Me.Doc = 0 Then
Me.lnFacNurse.Visible = False
Me.FacNurse.Visible = False
Me.FacNursePosit.Visible = False
Else
Me.lnFacNurse.Visible = True
Me.FacNurse.Visible = True
Me.FacNursePosit.Visible = True
End If
End Sub
The error code:
Run-time Error :2427
You entered an expression that has no value.
The Data:
CREATE DATABASE IF NOT EXISTS Incidents;
USE Incidents;
DROP TABLE IF EXISTS `FacilityIncidents`;
CREATE TABLE `FacilityIncidents` (
`FacIncidId` int(10) NOT NULL auto_increment,
`StaffID` int(10) NOT NULL,
`CadetID` int(10) default NULL,
`DTG` datetime default NULL,
`Location` varchar(100) default NULL,
`Subject` varchar(255) default NULL,
`Description` longtext character set utf8,
`User` varchar(50) NOT NULL,
`Computer` varchar(50) NOT NULL,
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
`IncidTypeID` int(10) unsigned NOT NULL,
`Doc` tinyint(4) default '0',
PRIMARY KEY (`FacIncidId`),
KEY `FacIncdId` (`FacIncidId`),
KEY `StaffId` (`StaffID`),
KEY `StaffId1` (`CadetID`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO `FacilityIncidents`
(`FacIncidId`,`StaffID`,`CadetID`,`DTG`,`Location`,`Subject`,`Description`,`User`,`Computer`,`TimeStamp`,`IncidTypeID`,`Doc`) VALUES
(1,1,NULL,'2007-06-28 00:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(2,1,NULL,'2007-06-26 00:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(3,1,NULL,'2007-08-04 16:00:00','Control
Tower',NULL,’test’.','','','2009-10-23 16:40:46',0,0),
(4,1,NULL,'2007-07-25 00:00:00','Control
Tower',NULL,’test','','','2009-10-23 16:40:46',0,0),
(5,1,NULL,'2007-09-27 00:00:00','Boot Camp Facility
Gate',NULL,’test.','','','2009-10-23 16:40:46',0,0),
(11,1,11,'2008-01-01
12:00:00','asdfasd','test','test','martinezjr','TRAININGNCO','2009-10-23
16:40:46',0,0),
(12,1,11,NULL,'TEST','TEST','TEST','MARTINEZJR','PLTSGT','2009-10-23
16:42:55',0,0),
(13,1,NULL,'2009-01-01
12:00:00','Test','asdfasdf','Testasdfasdfasdfasdfasdfasdf','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:40:46',0,0),
(14,1,58,'2009-01-01
12:12:00','Test','test','Testtesetsets','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:40:46',0,0),
(15,1,NULL,'2009-10-10
16:00:00','TEST','TEST','TEST','drillinstructor','DRILL-INSTRUCTO','2009-10-23 16:43:05',0,0);
The first part dealing with Me.CadetID works fine, but with the second part,
dealing with Me.Doc, that error keeps showing up. I have tried different ways
to that same statement using Nz(), Select Cases, !IsNull(), etc, but always
the same answer.
Please Help!!