Clarabella
New member
- Local time
- Today, 12:16
- Joined
- Nov 30, 2012
- Messages
- 5
Hi all,
I am totally baffled by a form based on a query I've been working on for a long time (years? :banghead
.
It is a very specialized search form with multiple fields (17!).
The form is unbound and I have three buttons that I use to perform different operations:
1) opens a new form with all results form the query
2) filters an existing form according to the parameters of the query
3) filters another existing form according to the paramenters of the query
I only have 1 query and if I open it directly it's working fine.
Button 1 works OK
Button 2 works OK
The code behind button 2 and 3 is the same, only the controls and fields name is different.
Problem is, when I launch Button 3 I get a 3175 error about wrongly set parenthesis:
This is the code that is giving the error:
If Len(Me.Titolo_Album) > 0 Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria & " AND ([Tbl_Audio_PRINCIPALEALBUM.Title] like '*" & Replace(Me![Titolo_Album], "'", "''") & "*')"
Else
stLinkCriteria = " ([Tbl_Audio_PRINCIPALEALBUM.Title] like '*" & Replace(Me![Titolo_Album], "'", "''") & "*')"
End If
End If
Could anyone pinpoint the problem or push me in the right direction?
If needed I can post more code.
Thank you!
Erika
I am totally baffled by a form based on a query I've been working on for a long time (years? :banghead

It is a very specialized search form with multiple fields (17!).
The form is unbound and I have three buttons that I use to perform different operations:
1) opens a new form with all results form the query
2) filters an existing form according to the parameters of the query
3) filters another existing form according to the paramenters of the query
I only have 1 query and if I open it directly it's working fine.
Button 1 works OK
Button 2 works OK
The code behind button 2 and 3 is the same, only the controls and fields name is different.
Problem is, when I launch Button 3 I get a 3175 error about wrongly set parenthesis:
This is the code that is giving the error:
If Len(Me.Titolo_Album) > 0 Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria & " AND ([Tbl_Audio_PRINCIPALEALBUM.Title] like '*" & Replace(Me![Titolo_Album], "'", "''") & "*')"
Else
stLinkCriteria = " ([Tbl_Audio_PRINCIPALEALBUM.Title] like '*" & Replace(Me![Titolo_Album], "'", "''") & "*')"
End If
End If
Could anyone pinpoint the problem or push me in the right direction?
If needed I can post more code.
Thank you!
Erika