B
bavjean
Hi all,
I have an event handler on the cmdOK button of a search form. I declare a
string variable, strWhere, which represents the WHERE part of the SQL syntax
used for searching.
I then call 2 functions that return strings and add them together to
strWhere, as follows:
strWhere = strWhere & SearchAnthroMain(Me, intSex, strSTLProp, strVFG)
strWhere = strWhere & SearchAnthroSub(Forms!frmPopUp_ZusätzVermessungen)
the first call(SearchAnthroMain) returns the following string:
"WHERE (qryAlleVPmEndwerte.Körperhöhe) >= 1740 AND
(qryAlleVPmEndwerte.Körperhöhe) <= 1760 AND ((qryAlleVPmEndwerte.Alter)
BETWEEN 20 AND 40) AND (qryAlleVPmEndwerte.VFG) = True AND"
and the second functon call(SearchAnthroSub) returns the following string:
" ((qryAlleVPmEndwerte.Beckenbreite) BETWEEN 320 AND 325) AND"
Fine, that is all correct, however, when adding the two together, it cuts
off the last part of the second string, as follows(I checked this using
debug.print for strWhere, and checking the value of the variable strWhere in
the locals window of VBE)
"WHERE (qryAlleVPmEndwerte.Sex) = 'm' AND (qryAlleVPmEndwerte.Körperhöhe)
True AND ((qryAlleVPmEndwerte.Beckenbreite)"
Why does it cut off the last part? Is the string data type too small? I
found this on MS’s description of the string data type for VBA:
„There are two kinds of strings: variable-length and fixed-length strings.
·A variable-length string can contain up to approximately 2 billion (2^31)
characters.
·A fixed-length string can contain 1 to approximately 64K (2^16) characters.
Note Public fixed-length string can't be used in a class module.“
I cannot figure why it is cutting off the last bit. Does anyone maybe know
where I missed something perhaps?
Thanks for your attention!
regards,
jean
I have an event handler on the cmdOK button of a search form. I declare a
string variable, strWhere, which represents the WHERE part of the SQL syntax
used for searching.
I then call 2 functions that return strings and add them together to
strWhere, as follows:
strWhere = strWhere & SearchAnthroMain(Me, intSex, strSTLProp, strVFG)
strWhere = strWhere & SearchAnthroSub(Forms!frmPopUp_ZusätzVermessungen)
the first call(SearchAnthroMain) returns the following string:
"WHERE (qryAlleVPmEndwerte.Körperhöhe) >= 1740 AND
(qryAlleVPmEndwerte.Körperhöhe) <= 1760 AND ((qryAlleVPmEndwerte.Alter)
BETWEEN 20 AND 40) AND (qryAlleVPmEndwerte.VFG) = True AND"
and the second functon call(SearchAnthroSub) returns the following string:
" ((qryAlleVPmEndwerte.Beckenbreite) BETWEEN 320 AND 325) AND"
Fine, that is all correct, however, when adding the two together, it cuts
off the last part of the second string, as follows(I checked this using
debug.print for strWhere, and checking the value of the variable strWhere in
the locals window of VBE)
"WHERE (qryAlleVPmEndwerte.Sex) = 'm' AND (qryAlleVPmEndwerte.Körperhöhe)
((qryAlleVPmEndwerte.Alter) BETWEEN 20 AND 40) AND (qryAlleVPmEndwerte.VFG) == 1740 AND (qryAlleVPmEndwerte.Körperhöhe) <= 1760 AND
True AND ((qryAlleVPmEndwerte.Beckenbreite)"
Why does it cut off the last part? Is the string data type too small? I
found this on MS’s description of the string data type for VBA:
„There are two kinds of strings: variable-length and fixed-length strings.
·A variable-length string can contain up to approximately 2 billion (2^31)
characters.
·A fixed-length string can contain 1 to approximately 64K (2^16) characters.
Note Public fixed-length string can't be used in a class module.“
I cannot figure why it is cutting off the last bit. Does anyone maybe know
where I missed something perhaps?
Thanks for your attention!
regards,
jean