473,382 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

need help with vba coding for a search by date range querry

Im entering this code and returns a syntax error message can anyone help with this

Private Sub Command29_Click()
'Search button
Call Search
End Sub
Sub Search()
Dim strCriteria, task As String

Me.Refresh
If IsNull(MeExpiryDateFrom) Or IsNull(Me.ExpiryDateTo) Then
MsgBox "Please enter the date range", vbInformation, "Date Range Required"
Me.expirydatefrom.SetFocus

Else
strCriteria = "([ExpiryDate] >= #" & Format(Me.expirydatefrom, "mm/dd/yyyy") & "# And[ExpiryDate] <=#" & Format(Me.ExpiryDateTo, "mm/dd/yyyy") & "#)"
task = "select *from Me.8CONST where (" & strrcriteria & ") order by [ExpiryDate]"
Me.Filter = strCriteria
Me.FilterOn = True
'DoCmd.ApplyFiltertask


End If

End Sub

Private Sub

Private Sub EXPIRY_DATE_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub EXPIRY_DATE_Enter()

End Sub
Nov 4 '16 #1
0 866

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products...
6
by: fonzie | last post by:
Is there any way to include two unbound text boxes (for a start date and end date) to a filter-by-form? The users may want to filter by several different fields and they may want to include a date...
0
by: rdemyan via AccessMonster.com | last post by:
I have a need to highlight a date range in a bar chart. If the "highlighting" is accomplished by changing the bar column color for the specific months in the date range, that would be great. ...
2
by: geek491 | last post by:
I want an SQL that displays all the days within the range given. SELECT <days> from <dual> where days between '01/01/2006' and '12/12/2006' Dual table is precent in Oracle but what is its...
2
by: yelena | last post by:
hi to everybody need help in selecting date range from for example 08/31/2007 to 09/01/2007 tryed many time no results :(
0
by: mwalsh62 | last post by:
Greetings all! My first post here, and my mind is pudding at this point (any flavor you like)! I have been searching for days, and still can't figure out the proper syntax that I require. This...
3
by: RoadRunner | last post by:
Hi, I am having a problem. I have a very simple employee database. The client needs to see everything on a form before any updates or deletions can be made. I have a form that loads with two...
12
by: jamieboy86 | last post by:
Hi Everyone, I'm new here and to access as well, The problem I'm having right now is that I made a Query that upon the input of a date, it will search for the last purchase I made and at what...
3
Midzie
by: Midzie | last post by:
Sample Records from table SLY TransDate Machine Person In Charge Type Feb. 7, 2008 BBAS Ashley B Feb. 8, 2008 BHAL Janelle C Feb. 9, 2008 ASCR Ness A Feb. 10, 2008 PLYR Jennifer D...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.