G
Guest
I'm using Access 2002. I have made a function to create a field value based
on the values of other fields. All of these fields are text fields, so I
declare them as strings, but whenever I run the query I am getting a data
mismatch error. Here's the code. Any thoughts would be much appreciated.
Public Function ConcTitle(strDistTitle As String, strSubtitle As String, _
strTitlePrefix As String, strTitle As String)
If IsNull(strDistTitle) Then
ConcTitle = strTitle & ", " & strTitlePrefix 'No Distinct Title
ElseIf IsNull(strSubtitle) Then
ConcTitle = strDistTitle 'No Subtitle
Else
ConcTitle = strDisTitle & ": " & strSubtitle 'Distinct Title with Subtitle
End If
End Function
on the values of other fields. All of these fields are text fields, so I
declare them as strings, but whenever I run the query I am getting a data
mismatch error. Here's the code. Any thoughts would be much appreciated.
Public Function ConcTitle(strDistTitle As String, strSubtitle As String, _
strTitlePrefix As String, strTitle As String)
If IsNull(strDistTitle) Then
ConcTitle = strTitle & ", " & strTitlePrefix 'No Distinct Title
ElseIf IsNull(strSubtitle) Then
ConcTitle = strDistTitle 'No Subtitle
Else
ConcTitle = strDisTitle & ": " & strSubtitle 'Distinct Title with Subtitle
End If
End Function