Hi,

This is my code :

Dim fullreason As String
fullreason = " "
Do While Not rswithd.EOF
Dim fs As Integer
fullreason = Trim(fullreason) + " " + "and" + Trim(rswithd!reason)
Print #1, Trim(fullreason)
Loop


for example :

fullreason contain values "10 pencil". i want only "10" from this string.


thanks.

1) Remove the Dim fs from inside the loop
2) When concatinating string use the & character as the + is for additon of numbers
3) Debug.Print Val("10 pencils")


Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.