Run query from date input on form

Hello all!

I have what I hope is a easy situation.  I have a table that has information
that is entered daily with a field "Completed Date".  I want to add a text
box to a form where a user can enter a date and hit a button that will run a
query for that specific completion date so I can have the query results
exported to Excel.  

Would I use an unbound text box on the form?  How would I set up the query to
take the date entered in the form?

Thank you very much!

- Joker

-- 
Message posted via http://www.accessmonster.com

0
The
1/7/2010 6:42:52 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
2126 Views

Similar Articles

[PageSpeed] 7

Yes, an unbound textbox would be one way to do it.

Your query would look something like:

SELECT * FROM yourTable
WHERE [Completed Date] = #" & forms!formname.textboxname & "#"

You can use the Docmd.OutputTo method to export these results to Excel.

----
HTH
Dale



"The Joker via AccessMonster.com" wrote:

> Hello all!
> 
> I have what I hope is a easy situation.  I have a table that has information
> that is entered daily with a field "Completed Date".  I want to add a text
> box to a form where a user can enter a date and hit a button that will run a
> query for that specific completion date so I can have the query results
> exported to Excel.  
> 
> Would I use an unbound text box on the form?  How would I set up the query to
> take the date entered in the form?
> 
> Thank you very much!
> 
> - Joker
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> .
> 
0
Utf
1/7/2010 8:25:01 PM
On 7 jan, 19:42, "The Joker via AccessMonster.com" <u17775@uwe> wrote:
> Hello all!
>
> I have what I hope is a easy situation. =A0I have a table that has inform=
ation
> that is entered daily with a field "Completed Date". =A0I want to add a t=
ext
> box to a form where a user can enter a date and hit a button that will ru=
n a
> query for that specific completion date so I can have the query results
> exported to Excel. =A0
>
> Would I use an unbound text box on the form? =A0How would I set up the qu=
ery to
> take the date entered in the form?
>
> Thank you very much!
>
> - Joker
>
> --
> Message posted viahttp://www.accessmonster.com

In the design of the query (in the criteria section) you put something
like:
[forms]![YourForm]![SelectedDate]

You can indeed use an unbound text box. But you could also make an
unbound combox which you populate with all the unique dates from your
table. In that case you are sure to select a date that gives at least
one result.

Groeten,

Peter
http://access.xps350.com
0
XPS350
1/7/2010 8:37:18 PM
Perfect!  Thank you!!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1

0
The
1/8/2010 6:23:19 PM
Reply:

Similar Artilces:

how to insert automatically date on emails sent and received
My outgoing emails and some i ncoming emails do not contain the date sent and received. ...

recall of infor on a form
I have created two tables: table one has basic info lname, fname, grade, student id number. Table two is an incident report form with fields: student id number, date ,grade , etc. I have a relationship from table one to to table two in a one to many relationship respectively. My user wishes to enter incidents on a form. So I created a form from table two and all works as planned. However my user would like to enter either a)student number or b) last name with out using a drop down list( long list of choices.) and then have it display both student number and last name then save...

Date formats in word
Using word 2007. If you type in a date, what appears to be an autocorrect option appears above. If you press enter the date is added to your date. If you press space it goes away. The date that is added is not the format we use in Austraila. How can that be changed. And how can this facility be disabled? When the date with the message Press enter to insert appears, just press the space bar instead. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally poste...

Some date &/or Times will not format
Good afternoon, I've imported some Date & Time data into excell, but when I try to format the colums as either date or time, some of the cells will not formatt. I've been told that sometimes importing data will result in hidden characters that will prevent formatting. Any way to correct this using a formula or other means? ex: 11/27/2009 16:23:00 PM . Best regards, -- Keith Nascarfan88 wrote: > Good afternoon, > > I've imported some Date & Time data into excell, but when I try to format > the colums as either date or time, some o...

Highlight keywords in result of perameter query
I have a query perameter "*" & [Keyword Search] & "*" the returns the records based on the keyword. Works great. Is there a way the keyword to be highlighted or change color in the results? Not that I know of. Especially in a query. -- John Spencer Access MVP 2002-2005, 2007-2008 Center for Health Program Development and Management University of Maryland Baltimore County .. "Ryan Tisserand" <RyanTisserand@discussions.microsoft.com> wrote in message news:34DD4D45-C312-4204-B53E-B22300A0613B@microsoft.com... >I have a query perameter &qu...

Forms #10
I run Exchange 2003 and MS Outlook 2003. I am wondering about forms under my scenario. Does someone know of a good site that details the use of forms? Thanks Custom Outlook forms? See the Forms pages at www.outlookcode.com -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mostro" <ksdks@aioscoiasn.com> wrote in message news:gJ5Cf.19265$Yu.3003@newssvr27.news.prodigy.net... >I run Exchange 2...

Save a date as a variable and run/convert formula against the vari
Good Day, What I'm needing to do is retrieve a date field from a closed workbook, save it as a variable and then calculate a week number based on it. which I'll use for another function. I've attached two types of code I'm struggling with in VB and hope someone can help... The first part retrieves a date from a close workbook and I need to change "MsgBox" to a varible to save the date retrieved. Sub GetVal() MsgBox TheValue("C:\GssReports", "gssreport MTTR.xlsx", "gssreport 1 ", "K6") End Sub Function...

Passing form name
I found this code (EnableFormControls) in the forum to enable/disable controls on a form but I'm having trouble setting the variable 'frmAny' and passing it to the sub EnableFormControls. What am I doing wrong? Sub EnableFormControls(frmAny As Form, _ strControlSkip As String, _ Optional tfEnable As Boolean = True) Dim ctlAny As Control On Error GoTo ERROR_Handler frmAny(strControlSkip).SetFocus For Each ctlAny In frmAny.Controls If ctlAny.Name <> strControlSkip Then Select Case ct...

Form goes blank when no records 12-15-09
Messaggio multiparte in formato MIME. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a form that goes blank when a user deletes all records. Is there a way to have vba to add a record when the form is open. This=20 would keep the form from going blank. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">...

Cannot open .mdb file in Access 2000 running Windows 2000 Professional
Good Afternoon All- I have a secured database that I am attempting to open with Access 2000 and I am getting a runtime error. There are three old machines in my office which run Windows 2000 Professional. I was able to get it to work on one machine by installing the updated MDAC file from a download from Microsoft. The other two machines generate the same error in that there is a runtime error with the switchboard. The MDAC file cannot be updated in Windows 2000 as it is in Windows XP. The i386 file does not contain the MDAC file and you can't right click on the file and then click i...

Select query problems Access 2003
Good morning everybody I'm using Access2003 on Windows XP SR2 I want to run a select query using parameters to query a table of placenames and details. All pretty straightforward. When I try a click event using the selection of a combo or listbox to set the criteria in the query { Forms![frmSearch]![cboName] } the query gives a nil return nothing happens....the form opens but doesn't display any results. But when is use a txtBox and manually enter known data and run a command button everything works as it should This is the code for the cmd button. Private Sub cmdS...

Incorrect date in line chart in Excel.
I'm having difficulty with a line chart. I've got two ranges of numbers of two types of calls (from 1972 through 2004) that goes up from 50 to 7700. My chart's Y axis has automatically decided to show from 0 to 16,000. On the chart itself, my data placement starts at about 6,000 (for both 24 “F” calls and 649 “M” calls in the year 1972) and goes up to a point above 14,000 (for a figure that should only be just above 7000). I've tried to change the scale of my Y axis, but when I am able to so (2 out of 5 times) my data then goes off the chart. So I've looked at m...

problem with append query
Hello experts, I have a form witha subform, I need to append the records from the subform into a table. I set it up and it seems to be fine but there is a problem. Only one record from the subform is appended into the table and it is always the record that is selected. is there any way to send all the records that are showing in the subform window to the table? Thanks again in advance Isn't this the same question I just replied to in the Reports NG? Please ask your question in a single NG. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UC...

Convert Text Entry to Date Format
Hello We were sent a large spreadsheet with hundreds of dates entered as text in this format: 04151985. Each entry has the green triangle in the upper left corner of the cells designating the data as text. We need to change the format to 04/15/1985. I have tried DateValue with no luck. I get a "#value" error I have also tried converting the text to a number first and then formating as a date using "format/cells" but I only get a string of pound signs ####. Please help. Thanks Art Sorry, I just read some of the archived postings and figured out the solution. ...

Duplicate Dates Problem
Hello, Using Excel 2007. I have three Columns of data, similar to this: Wish to have the dates as the X axis, and show the next two Columns on the same plot. 21-Apr 143 21 26-Apr 147 93 3-May 144 91 13-May 135 128 13 May 128 81 17-May 143 93 17 May 137 86 22-May 127 89 22-May 123 83 I have the first, the Date column, formatted as: Date / 14 Mar I was hoping to graph this data, and have a line connecting "all" the points (of each column's data). For the second Column, I do have lines connecting the data with the unique dates of 21 Apr thru 3 May For some reaso...

Due date on loan account
How do I change the due date on a loan account? I can change the loan terms and interest rate, but I can't figure out how to change the due date. Changing the date on the bill series doesn't do it. More context might help. Are you talking about an Apay configured through Money? If changing the date on the bill series doesn't do what you are wanting to do, what is it you are wanting to change? What will appear different or happen differently? "Dave Has No Money" <DaveHasNoMoney@discussions.microsoft.com> wrote in message news:C372A2D6-665C-4A65-BE51-B2FFDD5...

use global variable and email a form
I have a form, FORM1, and behind FORM1's on_click button labeled "Email", I try to write codes that use a global variable, glbStudID, to hold a value that affects the whole project. I pass this global variable to another sub procedure. In this sub procedure, I try to email FORM2 that has a field matching glbStudID. The recordset of FORM2 would include StudID=glbStudID and other related fields. Since the recordset pull out many records so I will use a loop to go through each Stud, email each student info, and then go to next student. Is this possible? Thank you. ...

Trim Time off Date
Access 2007 linked to SQL 2008 database I have a query with a date field that has the time included on it. How do I trim, truncate, remove the time part of the date in the query field named cndate? I might use an expression like the following: IIF(IsDate(cnDate),DateValue(cnDate),Null) Or perhaps a bit faster IIF(CNDate is Not null, DateValue(cnDate),Null) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County GMC -LSND wrote: > Access 2007 linked to SQL 2008 database > > I have a query with ...

Query to Filter by Dates, Using Form
I’m kind of stuck on a query! This works fine, when I just filter for Customers and Traders. Then, I went ahead and added in a couple of ComboBoxes, to allow me to choose a From-Date and a To-Date…now my dynamic query doesn’t work anymore… This SQL Works fine for Cust and Trader, but not for dates: SELECT * FROM Trades WHERE Trades.[Cust] IN('') AND Trades.[Trader] IN(''); Below is my SQL for filtering by dates, but it DOES NOT WORK: SELECT * FROM Trades WHERE ((Trades.Tdate) Between [forms]![SearchForm]![cboFrom] And [forms]![SearchForm]![cboTo]) AND Trad...

displaying Query results to subform
First--the disclaimer--I am in no way a programmer, but I am working diligently to support my team in any way possible. With that said, I have painstakingly created a simple build SQL string code in Access Visual Basic Editor: Private Sub Command8_Click() Dim SQL As String SQL = "SELECT * " & _ "FROM [BCSG_CARDFILE] " & _ "WHERE ((([BCSG_CARDFILE].[IMPORT_FILENAME]) Between " & _ """" & _ Forms![BCSG_CARDFILE_SEARCH]!cboDateFrom.Value & _ """" & _ " And &quo...

cell input
Hellow all, I am really new with excel. I think this is the third or fourth time that i really opened excel. But now i have to work with it and stumbled accross my first problem. I have this column where you can put data. What i want to accomplish is that you have a choice. So the only information you can put in this cell is something like a pulldown. Do i make any sense? greetz, walter +-------------------------------------------------------------------+ |Filename: pulldown.gif | |Download: http://www.excelforum.com/attachment.php?postid=3679...

Design the Contact Form
Hi, I want to add a few fields to the standard Contacts form. When I select Design this Form it flickers and I end up looking at a basic version of some kind. I am using Office 2010 so I'm not sure why this happens. Pointers most welcome. Also I too end up with the sticky note icon and not a contacts icon for new contacts using this form. P.S. I can now add that I think it might be the differences between Forms 2.0 controls and Outlook controls. I have added all the Outlook controls to my Control Toolbox but still no joy... ...

Need help in Dates Calculations.
Hello every Body. I have a DB in which i want that it will show me the report by taking a Parameter through keyboard and the Parameter value should be Date. It will take the date and filter all the records of the concern date. how would be it possible? Can any one help please...? the second thing is that when i give the date of birth in the DOB Field and Current Date in the Present Date Field it whould display the Difference in years between the two dates. But how.? urgent help needed please. Regards, Khaksar. See: http://allenbrowne.com/func-08.html The article explains some...

Event Log Queries
Ok, so I'm working on querying multiple DC's to look for a specific event ID (645 in the security logs, for computers recently joined to the domain). I thought I had everything figured out, but it's still not working right. Running the script, it just somewhat hangs...not sure if that's just because it's still searching or not and is slow. Let me know if you guys have any thoughts...thanks! Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionary") arrComputers = Array("DC02", "DC03") iReach = 0 For Each st...

Change year end date
I'm fairly new to Great Plains so please be gentle with me. Can someone confirm how you go about extending the year end date, before I close the year. Currently our system is configured to run from 1/1/2005 to 31/12/2005 (I'm in the UK), but for one year only, we are extending our companies financial year to 31/3/2006. I believe the way to do it, is to go in to Setup->Company->Fiscal Periods and select year 2005, change the last day to be 31/3/2006, then change the number of fiscal periods to 15 (I already have 12 months). Then for 2006 change the first day to be 1/4/2006 and l...