Thanks, Micron. I am pretty sure of the values that I am trying to insert. I moused over and used debug,print, both, and they showed the expected values. The second query should have read as follows (See NewID() in red:
Code:
DoCmd.RunSQL "INSERT INTO RebootSchedule ([RebootScheduleID], [RebootWeek], [RebootTime], [Mon], [Tue], [Wed], [Thu], [Fri], [Sat], [Sun], [IsTemp], " & _
"[RequireSpecialInstructions], [RequireEveningReboot]) " & _
"VALUES (' NewID() ', '" & sWk & "', '" & TimeValue(Me.txtTime) & "', " & Me.chkMon & ", " & Me.chkTue & ", " & Me.chkWed & ", " & Me.chkThu & ", " & Me.chkFri & ", " & _
"" & Me.chkSat & ", " & Me.chkSun & ", " & Me.chkTemp & ", " & Me.ChkSpecial & ", " & Me.chkPM & ")"
This query works and give me a new RebootScheduleID. My concern is that, logically the new RebootScheduleID should be created in the RebootScheduleLocalServer table first as it is the link between the LogicalServer table and the RebootSchedule table as in the following query:
Code:
SELECT LogicalServer.Name, RebootSchedule.RebootWeek, TimeValue(RebootSchedule.RebootTime) AS BootTime, RebootSchedule.Mon, RebootSchedule.Tue, RebootSchedule.Wed, RebootSchedule.Thu, RebootSchedule.Fri, RebootSchedule.Sat, RebootSchedule.Sun, RebootSchedule.IsTemp, RebootSchedule.RequireSpecialInstructions, RebootSchedule.RequireEveningReboot, IsNull([LogicalServer].[DecommissionDate]) AS Expr1, RebootScheduleLogicalServer.RebootScheduleID
FROM (LogicalServer INNER JOIN RebootScheduleLogicalServer ON LogicalServer.LogicalServerID = RebootScheduleLogicalServer.LogicalServerID) INNER JOIN RebootSchedule ON RebootScheduleLogicalServer.RebootScheduleID = RebootSchedule.RebootScheduleID
WHERE (((IsNull([LogicalServer].[DecommissionDate]))<>False))
ORDER BY LogicalServer.Name;
What do you think?