Mcblake
asked on
Change Recordsource using SQL
I would like to change my recordsource using SQL and filter my recordsouce using Date.. So, I try to create source code like this
data1.recordsource = "select * from mytable where proddate = " & maskedbox1.text
It show nothing , So, I try
data1.recordsource = " select * from mytable where proddate = " & "'" & maskedbox1.text & "'"
It show an error data type mismatch..
So, I try for declare variable as date
dim sdate as date
sdate = proddate
data1.recordsource = "select * from mytable where proddate = " & sdate
It still show nothing, even I try
data1.recordsource = "select * from mytable where proddate = " & "5/5/98"
It still show nothing.. How could I solve this problem?
PS. I use MS-Access 95 as my database and proddate is a field use Date as data type , format shortdate..
Thank you in advance.
data1.recordsource = "select * from mytable where proddate = " & maskedbox1.text
It show nothing , So, I try
data1.recordsource = " select * from mytable where proddate = " & "'" & maskedbox1.text & "'"
It show an error data type mismatch..
So, I try for declare variable as date
dim sdate as date
sdate = proddate
data1.recordsource = "select * from mytable where proddate = " & sdate
It still show nothing, even I try
data1.recordsource = "select * from mytable where proddate = " & "5/5/98"
It still show nothing.. How could I solve this problem?
PS. I use MS-Access 95 as my database and proddate is a field use Date as data type , format shortdate..
Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.