Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2007

Tip: Looking for answers? Try searching our database.

Form and Requery

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
G-Man - 13 Mar 2007 20:41 GMT
I have a form that is baed on a particular query that contains two different
sets of date criteria.

By default, the form opens with the beginning date this item was generated
generated and ends with today's date.  But there's a search box on the form
so instead of getting 2 years worth of date, they can specify a narrower date
range.

This simply requerys the information based on the new beginning and new end
date.

OK so far.  But this relaeds to the date the item was GENERATED. The form
also tracks the date the item was COMPLETED.  How can I requery based on this
different set of date criteria.  Can I requery based on a seperate query
(probably not?)

I would like to have my beginning and ending search box . . . . but inclide
a checkbox that would the the search to search by the COMPLETED Dates rather
than the GENERATED DATES

I know I'm not making good sense. But I have to start somewhere
Access101 - 13 Mar 2007 21:59 GMT
Let me know if this is helpful:

If the box is checked, you use one query as the recordsource for the form,
if it's not, you use a different query. The first one pulls from the
Generated Start/End, the second from the Completed Start/End dates.

If Me.CheckBox Then

   strSQL = "SELECT Table1.G_StartDate, Table1.G_EndDate,
Table1.C_StartDate, Table1.C_EndDate" & _
   " FROM Table1" & _
   " WHERE (((Table1.G_StartDate)=" &
[Forms]![frmData]![GeneratedStartDate] & ") AND ((Table1.G_EndDate)=" &
[Forms]![frmData]![GeneratedEndDate] & "));"
   
Else

   strSQL = "SELECT Table1.G_StartDate, Table1.G_EndDate,
Table1.C_StartDate, Table1.C_EndDate" & _
   " FROM Table1" & _
   " WHERE (((Table1.C_StartDate)=" &
[Forms]![frmData]![CompletedStartDate] & ") AND ((Table1.C_EndDate)=" &
[Forms]![frmData]![CompletedEndDate] & "));"
   
End If

Me.RecordSource = strSQL

> I have a form that is baed on a particular query that contains two different
> sets of date criteria.
[quoted text clipped - 17 lines]
>
> I know I'm not making good sense. But I have to start somewhere
G-Man - 21 Mar 2007 23:54 GMT
Thank you so much for the response. I have simply been overwhelmed with stuff
and have just now got back to this. I will get back to you in the next day or
so. I really appreciate your response.

> Let me know if this is helpful:
>
[quoted text clipped - 45 lines]
> >
> > I know I'm not making good sense. But I have to start somewhere
G-Man - 05 Apr 2007 01:14 GMT
Tahnks so much. Finally found time to look this over again, your post was
right on track.  Helped me "span a knowledge gap" so to speak!

> Let me know if this is helpful:
>
[quoted text clipped - 45 lines]
> >
> > I know I'm not making good sense. But I have to start somewhere
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.