I am trying to filter ProjectID's in qryStartDates where Year = cboYear.value and filter these projectID's into my frmProject:
DoCmd.OpenForm "frmProjects", ,"qryStartDates" , "Year=" & cboYear.value
How can I make this work?
I am trying to filter ProjectID's in qryStartDates where Year = cboYear.value and filter these projectID's into my frmProject:
DoCmd.OpenForm "frmProjects", ,"qryStartDates" , "Year=" & cboYear.value
How can I make this work?
Year is a reserved and should not use reserved words as names for anything. If you do, enclose in [ ].
Don't use both FilterName and WhereCondition arguments. I have NEVER used FilterName.
DoCmd.OpenForm "frmProjects", , , "[Year]=" & Me.cboYear
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you June7.
Where do I specify the qryStartDate where the ProjectID will be retrieved from and used as a filter for frmProject?
Not sure what you are asking. Include as many filter parameters as you want in the WhereCondition.
On reflection, maybe FilterName and WhereCondition arguments will work together. Never actually tried.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
let me explain:
My application opens up a form called frmProjects.
i have a table that has all my projects listed where frmProjects gets the data from.
I have a query called qryStartDate where I can get all the projectID's for year 2018.
How can I write an open form statement that would allow me to do this?
If that query contains all the fields needed in your form, just make it the recordsource for the form. All done.I have a query called qryStartDate where I can get all the projectID's for year 2018.
I dont want to change my form recordsource this is why i am trying to run a filter.
If you want to filter on year 2018 and qryStartDates contains only 2018 dates, the where criteria is redundant. Try
DoCmd.OpenForm "frmProjects", ,"qryStartDates"
If you get an error, kindly let us know exactly what it is.
Check out Dynamic Query Examples. That should help you understand how to build where clauses and filters.
if the query has a criteria how do I pass the criteria value
DoCmd.OpenForm "frmProjects", ,"qryStartDates"
Post the query SQL statement.
If you want to provide db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.