hi
I am facing a problem in vb with crystal report the code is as under :

on running it is some showing error in formula

mn = Cmb_Mnth.Text
yr = Val(Cmb_Yr.Text)

Crpt1.Connect = "UID=sa;PWD=;DSN=WORK"
Crpt1.ReportFileName = "D:\WORK\REPORT1.RPT"
Crpt1.SelectionFormula = "{Emp_Bill.bl_mnth} = " & mn & " " And "{Emp_Bill.bl_yr} =" & yr & " "
Crpt1.Action = 1

text fields needs to be enclosed by quotes.

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.