Advertisement

06.16.2008 at 07:55AM PDT, ID: 23488336
[x]
Attachment Details

Access Database Search Function for Date

Asked by Dingo212 in Access Coding/Macros, Microsoft Access Database, Access Forms

Tags: Microsoft, Access, 2003

Hello all,

I would like to develop a date search from Form in Access. Here is the sample of previous search coding I have developed used the help of experts on this site.

I do want to develop something similar. From my research I gathered something like this that would go under the cmbSearch_Click function

- Date is the title of the date column and Entry is the title of the Table where the dates are stored. The dates are listed as MM/DD/YYYY in the table

  If Not IsNull(txtDate) AND IsDate(txtDate) Then
    GCriteria6 = "SELECT Entry.* FROM Entry" _
         & " WHERE Format([Date],'dd/mm/yyyy')= #" _
         & Format(txtDate, "dd/mm/yyyy") & "#"
 
    If GCriteria = "" Then
               GCriteria = GCriteria6
     Else
         GCriteria = GCriteria & " AND " & GCriteria6
   End If
 End If


Now the problem is to give the user a message if he enters the date is wrong format...I don't know where exactly that msg code would go or how to check if the user entered wrong date. And please do check if my code "looks right" too.

Thanks in advance for your time!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
'Sample of code that i am using to search and output
'Approach to CSR
    If Not IsNull(txtSearchField12) Then
        GCriteria4 = GetResults(Me.txtSearchField12, "[ApproachtoCSR]", Me.optSearch)
 
        If GCriteria = "" Then
           GCriteria = GCriteria4
 
        Else
              GCriteria = GCriteria & " AND " & GCriteria4
        End If
   
    End If
       
    'Publisher
    If Not IsNull(cboSearchField2) Then
        GCriteria5 = GetResults(cboSearchField2.Value, "[Publisher]", Me.optSearch)
 
            If GCriteria = "" Then
               GCriteria = GCriteria5
 
           Else
                GCriteria = GCriteria & " AND " & GCriteria5
           End If
          
    End If
              
    Form_frmInput.RecordSource = "select * from Entry where " & GCriteria & ";"
 
    Form_frmInput.Requery
   
    If Form_frmInput.NewRecord Then
        MsgBox "No matching records found. Try less restricted search criteria", vbOKOnly, "No Matches Found"
       
    Else
        MsgBox "Results have been filtered.", vbOKOnly, "Search Successful"
        DoCmd.Close acForm, "frmSearch"
    End If
 
Keywords: Access Database Search Function for …
 
Loading Advertisement...
 
[+][-]06.16.2008 at 08:17AM PDT, ID: 21794434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 08:42AM PDT, ID: 21794689

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 08:43AM PDT, ID: 21794700

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.16.2008 at 08:43AM PDT, ID: 21794702

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:01AM PDT, ID: 21794884

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:29AM PDT, ID: 21795168

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:39AM PDT, ID: 21795261

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:45AM PDT, ID: 21795314

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 11:18AM PDT, ID: 21796072

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 02:41PM PDT, ID: 21797799

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 02:45PM PDT, ID: 21797829

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.17.2008 at 05:42AM PDT, ID: 21802299

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 05:52AM PDT, ID: 21802379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 05:52AM PDT, ID: 21802383

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 05:54AM PDT, ID: 21802397

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 05:58AM PDT, ID: 21802432

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 05:58AM PDT, ID: 21802439

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:04AM PDT, ID: 21802505

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:06AM PDT, ID: 21802519

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:17AM PDT, ID: 21802601

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:34AM PDT, ID: 21802782

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:44AM PDT, ID: 21802868

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:47AM PDT, ID: 21802916

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 06:59AM PDT, ID: 21803073

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 07:04AM PDT, ID: 21803134

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 07:13AM PDT, ID: 21803229

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 08:08AM PDT, ID: 21803864

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 08:09AM PDT, ID: 21803876

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 11:03AM PDT, ID: 21805760

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, Access Forms
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: cactus_data
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.17.2008 at 11:16AM PDT, ID: 21805854

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 11:24AM PDT, ID: 21805927

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 11:38AM PDT, ID: 21806075

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 02:01PM PDT, ID: 21807433

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628