C
croy
When my general-purpose form opens to a new record, the
following dialog arises:
Syntax error (missing operator) in query expression
'[IvSurvId] ='.
But I don't see the problem in the code.
I think the offending code is:
*****
Private Sub Form_Current()
Dim strWhere As String
Dim strWhere2 As String
strWhere = "[IvSurvId] = " & Me.Parent![IvSurvId]
strWhere2 = "[IvSurvId] = " & Me.Parent![IvSurvId] _
& " And [IvPage] = " & Me![txtIvPage].DefaultValue
Me![txtIvPage].DefaultValue = _
Nz(DMax("IvPage", "qryIvDetails", strWhere), 1)
Me![txtIvLine].DefaultValue = Nz(DMax("IvLine", _
"qryIvDetails", strWhere2), 0) + 1
If Me.Parent![cboIvType] = 1 Then
Me![cboDone].DefaultValue = 0
ElseIf Me.Parent![cboIvType] = 2 Then
Me![cboDone].DefaultValue = -1
End If
End Sub
*****
Does anyone see the error in the code?
Access 2002.
following dialog arises:
Syntax error (missing operator) in query expression
'[IvSurvId] ='.
But I don't see the problem in the code.
I think the offending code is:
*****
Private Sub Form_Current()
Dim strWhere As String
Dim strWhere2 As String
strWhere = "[IvSurvId] = " & Me.Parent![IvSurvId]
strWhere2 = "[IvSurvId] = " & Me.Parent![IvSurvId] _
& " And [IvPage] = " & Me![txtIvPage].DefaultValue
Me![txtIvPage].DefaultValue = _
Nz(DMax("IvPage", "qryIvDetails", strWhere), 1)
Me![txtIvLine].DefaultValue = Nz(DMax("IvLine", _
"qryIvDetails", strWhere2), 0) + 1
If Me.Parent![cboIvType] = 1 Then
Me![cboDone].DefaultValue = 0
ElseIf Me.Parent![cboIvType] = 2 Then
Me![cboDone].DefaultValue = -1
End If
End Sub
*****
Does anyone see the error in the code?
Access 2002.