If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Error 94 Invalid Use of Null
This code was working at first with the help of the experts on this site but
I went on a 2 week Military Training and came back to finish up this database and now it's giving me an error of "Error 94 Invalid Use of Null". What in creation could have happened? This is my code. Could it be the formatting on the form? I think I changed the formatting of cells and am not using some of the fields. Please HELP!! Private Sub AddAppt_Click() On Error GoTo AddAppt_Err ' Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord ' Exit the procedure if appointment has been added to Outlook. If Me!AddedToOutlook = True Then MsgBox "This appointment already added to Microsoft Outlook" Exit Sub ' Add a new appointment. Else Dim outobj As Outlook.Application Dim outappt As Outlook.AppointmentItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olAppointmentItem) With outappt .Start = Me!ApptDate & " " & Me!ApptTime .Duration = Me!ApptLength .Subject = Me!Appt If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes If Not IsNull(Me!ApptLocation) Then .Location = _ Me!ApptLocation If Me!ApptReminder Then .ReminderMinutesBeforeStart = Me!Reminderminutes .ReminderSet = True End If .Save End With End If ' Release the Outlook object variable. Set outobj = Nothing ' Set the AddedToOutlook flag, save the record, display a message. Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Appointment Added!" Exit Sub AddAppt_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub End Sub -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Error 94 Invalid Use of Null
I got it working for now.. had deleted a field that I guess needs to be on
the form obviously. Konchetta wrote: This code was working at first with the help of the experts on this site but I went on a 2 week Military Training and came back to finish up this database and now it's giving me an error of "Error 94 Invalid Use of Null". What in creation could have happened? This is my code. Could it be the formatting on the form? I think I changed the formatting of cells and am not using some of the fields. Please HELP!! Private Sub AddAppt_Click() On Error GoTo AddAppt_Err ' Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord ' Exit the procedure if appointment has been added to Outlook. If Me!AddedToOutlook = True Then MsgBox "This appointment already added to Microsoft Outlook" Exit Sub ' Add a new appointment. Else Dim outobj As Outlook.Application Dim outappt As Outlook.AppointmentItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olAppointmentItem) With outappt .Start = Me!ApptDate & " " & Me!ApptTime .Duration = Me!ApptLength .Subject = Me!Appt If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes If Not IsNull(Me!ApptLocation) Then .Location = _ Me!ApptLocation If Me!ApptReminder Then .ReminderMinutesBeforeStart = Me!Reminderminutes .ReminderSet = True End If .Save End With End If ' Release the Outlook object variable. Set outobj = Nothing ' Set the AddedToOutlook flag, save the record, display a message. Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Appointment Added!" Exit Sub AddAppt_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub End Sub -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Error 94 Invalid Use of Null
I got it working for now.. had deleted a field that I guess needs to be on
the form obviously. Konchetta wrote: This code was working at first with the help of the experts on this site but I went on a 2 week Military Training and came back to finish up this database and now it's giving me an error of "Error 94 Invalid Use of Null". What in creation could have happened? This is my code. Could it be the formatting on the form? I think I changed the formatting of cells and am not using some of the fields. Please HELP!! Private Sub AddAppt_Click() On Error GoTo AddAppt_Err ' Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord ' Exit the procedure if appointment has been added to Outlook. If Me!AddedToOutlook = True Then MsgBox "This appointment already added to Microsoft Outlook" Exit Sub ' Add a new appointment. Else Dim outobj As Outlook.Application Dim outappt As Outlook.AppointmentItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olAppointmentItem) With outappt .Start = Me!ApptDate & " " & Me!ApptTime .Duration = Me!ApptLength .Subject = Me!Appt If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes If Not IsNull(Me!ApptLocation) Then .Location = _ Me!ApptLocation If Me!ApptReminder Then .ReminderMinutesBeforeStart = Me!Reminderminutes .ReminderSet = True End If .Save End With End If ' Release the Outlook object variable. Set outobj = Nothing ' Set the AddedToOutlook flag, save the record, display a message. Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Appointment Added!" Exit Sub AddAppt_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub End Sub -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|