Runtime Error 424 Object missing

Monstermechanic

Registered User.
Local time
Today, 07:32
Joined
Jan 31, 2006
Messages
16
Need some help if possible, Thanks
Working on a Database where a "Request Date" is entered.
then based on a Drop Down "Catagory" of I-IV a "Due Date" is to be autimatically generated and populate the "Due Date" field. Below is the code, however I'm receiving a Runtime Error 424 Object Missing. Any Suggestions.



Public Function FillCARDueDate()
Dim requestDate As Date
Dim Category As String
Dim dueDate As Date
Dim due As String

[Forms]![General Report & Incident Page]![CAR Request Date].[SetFocus]
requestDate = CDate([Forms]![General Report & Incident Page]![CAR Request Date].[Text])

[Forms]![General Report & Incident Page]![Category].[SetFocus]
Category = [Forms]![General Report & Incident Page]![Category].[Text]

If Category = "I" Then
dueDate = DateAdd("d", 1, requestDate)
ElseIf Category = "II" Then
dueDate = DateAdd("d", 10, requestDate)
Else
dueDate = DateAdd("d", 30, requestDate)
End If

due = CStr(dueDate)

[Forms]![General Report & Incident Page]![CAR Due Date in CAR Tab].[SetFocus]
[Forms]![General Report & Incident Page]![CAR Due Date in CAR Tab].[Text] = due

FillCARDueDate = ""
 
On what line? You can drop all the set focus lines if you drop the .Text from your form references (and it could be the brackets around those causing your problem).
 
Sorry, Next to last line.

[Forms]![General Report & Incident Page]![CAR Due Date in CAR Tab].[Text] = due
 
Did you try dropping the set focus lines and .Text as I suggested? Or at least the brackets around Text.
 

Users who are viewing this thread

Back
Top Bottom