[AccessD] Concatenated stLinkCritria produces Type mismatch error.

bruce_bruen at mlc.com.au bruce_bruen at mlc.com.au
Tue Jan 27 18:43:59 CST 2004





    stLinkCriteria = "[KundenName]=" & "'" & Me![KundenName] & "' And
[VerbandNr]=" & Me![VerbandNr]

Youve left the "AND" out of your strLinkCriteria.


                                                                                                                                               
                      Helmut.E.Kotsch at t-online.                                                                                                
                      de (Helmut Kotsch)               To:       <accessd at databaseadvisors.com>                                                
                      Sent by:                         cc:                                                                                     
                      accessd-bounces at databasea        Subject:  [AccessD] Concatenated stLinkCritria produces Type mismatch error.            
                      dvisors.com                                                                                                              
                                                                                                                                               
                                                                                                                                               
                      28/01/2004 10:11                                                                                                         
                      Please respond to Access                                                                                                 
                      Developers discussion and                                                                                                
                      problem solving                                                                                                          
                                                                                                                                               
                                                                                                                                               




Hi,
I am trying to open a form where 2 conditions have to be met.
When only one conditon (as shown in code below as sample#1 and sample#2) is
set than it works ok.

Sample#1  ==> OK

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "VERDI-Kunden"
    stLinkCriteria = "[KundenName]=" & "'" & Me![KundenName] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Sample#2 ==> OK

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "VERDI-Kunden"
    stLinkCriteria = "[VerbandNr]=" & Me![VerbandNr]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

However when concatenating both conditions as shown in the following code I
get a "Type mismatch" error.

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "VERDI-Kunden"
    stLinkCriteria = "[KundenName]=" & "'" & Me![KundenName] & "'" And
"[VerbandNr]=" & Me![VerbandNr]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Hope someone can help before this one drives me grazy.


Helmut Kotsch

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list