Lifeseeker
Registered User.
- Local time
- Today, 07:14
- Joined
- Mar 18, 2011
- Messages
- 273
Hi,
I have following code:
The code is placed in a standard module, and I am invoking it from a query. like this:
so i'm getting an erorr saying Visual Basic editor has a syntax error. The discharge Date in the table contains empty values. Maybe this is why?
How should I fix this problem? I also tried this:
But it's not working.
I have following code:
Code:
Option Compare Database
Option Explicit
Public Function AssignWeeklyDisch(DischargeDate As Date) As Integer
'starts assigning weeklys
If DischargeDate.Value = "" Then
AssignWeeklyDisch = 100
End If
If DischargeDate >= #4/1/2012# And DischargeDate < #4/8/2012# Then
AssignWeeklyDisch = 1
End If
The code is placed in a standard module, and I am invoking it from a query. like this:
Code:
test: AssignWeeklyDisch([DischargeDate])
so i'm getting an erorr saying Visual Basic editor has a syntax error. The discharge Date in the table contains empty values. Maybe this is why?
How should I fix this problem? I also tried this:
Code:
If IsNull(DischargeDate) = "" Then
AssignWeeklyDisch = 100
End If
But it's not working.