why i am getting type mismatch error in the following code ??? . kindly let me know the idea . any help would be highly appreciated !!!Code:
Print #1, rs!QTY + "," + "",
Print #1, rs!Price + ","
Printable View
why i am getting type mismatch error in the following code ??? . kindly let me know the idea . any help would be highly appreciated !!!Code:
Print #1, rs!QTY + "," + "",
Print #1, rs!Price + ","
You should use the ampersand '&' instead of the plus +' when concatenating strings.
Quote:
You should use the ampersand '&' instead of the plus +' when concatenating strings.
:wave:Code:Print #1, "Saudi Arabia ", " """,
Print #1, Day(Now); "," + "",
Print #1, Format(Now, "mmm"); "," + "",
Print #1, Year(Now); "," + "",
Print #1, rs!STOREID & "," + "",
Print #1, rs!itemid & "," + "",
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Print #1, rs!QTY & "," + "",
Print #1, rs!Price & "," + ""
I see + signs, still...Code:
Print #1, "Saudi Arabia ", " """,
Print #1, Day(Now); "," + "",
Print #1, Format(Now, "mmm"); "," + "",
Print #1, Year(Now); "," + "",
Print #1, rs!STOREID & "," + "",
Print #1, rs!itemid & "," + "",
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Print #1, rs!QTY & "," + "",
Print #1, rs!Price & "," + ""
Yep lot's of em
while + will work in many cases the & is the way to go, it always works and makes the code much easier to understand at a quick glance.
also have no idea why this type of thing is even there
Adding an empty string to the end in these cases will do absolutely nothing beyond making the program slightly slower and require more time fromt he programmer who typed the extra characters into the editor.Code:Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
"," + "" = "," btw
Also looks like there is a comma missing after serial2
where + sign is missing ???.kindly put some color over it !!!!!!!!!!!.:(Quote:
I see + signs, still... Code:
Print #1, "Saudi Arabia ", " """, Print #1, Day(Now); "," + "", Print #1, Format(Now, "mmm"); "," + "", Print #1, Year(Now); "," + "", Print #1, rs!STOREID & "," + "", Print #1, rs!itemid & "," + "", Print #1, rs!serial1 & "," + "", Print #1, rs!serial2 & "," + "" Print #1, rs!QTY & "," + "", Print #1, rs!Price & "," + ""
Go back and read it again...
Quote:
You should use the ampersand '&' instead of the plus +' when concatenating strings.