Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Forms Coding > VBA Coding a Pa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 41542 of 43412
Post > Topic >>

VBA Coding a Parameter Query

by =?Utf-8?B?QUpPTFNPTg==?= <AJOLSON@[EMAIL PROTECTED] > Aug 7, 2008 at 08:08 AM

I have a form that when is opened executes a parameter query.  The user
Types 
in a date and poof the record set selected and only returns the desired
date. 
  Once the parameter query has been established about 5  different queries

that are based on the original parameter query are set and the user then
is 
able to print out a variety of re****ts.
What I don’t like is that the user has to “Fat-Finger’ in the Date. 
I would 
rather them select a date from a combo box and have that fill in the 
parameter query.  I have tried everything I can to make that happen. 
Tried 
Filtering yada yada yada but that only filtered the query and did not pass

that along to the sub quieres like executing a parameter query does.  
Does anyone know what code I would use to allow the contents of a Combo
box 
to create a parameter query?     
This is what I have done so far.  I have set up a Form that has a combo 
box(with a series of Date) in it and a command button.  The user selects
the 
date then clicks on the command button.   The command button then opens a 
form with the Parameter query as its control source.  The problem is the 
first thing the parameter query wants, before running any code is a 
“Fat-Fingered” date. 
Here is my code
FYI ***[StartDate] is the parameter that controls the[ DayofProduction] 
field within the query.

Private Sub Command2_Click()
Dim stDocName As String
Dim stLinkCriteria1 As String
stDocName = "AllWeeklyRe****tFirstSort"
stLinkCriteria1 = "[Startdate] =" & Format(Me.ComboDate,
"\#mm\-dd\-yyyy\#")
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1, acFormReadOnly
End Sub
[StartDate] is the parameter that controls the DayofProduction field
 




 2 Posts in Topic:
VBA Coding a Parameter Query
=?Utf-8?B?QUpPTFNPTg==?=   2008-08-07 08:08:22 
Re: VBA Coding a Parameter Query
"Douglas J. Steele&q  2008-08-07 12:08:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:50:03 CST 2008.