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 = ""
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 = ""