Input boxes to capture criteria information

ConfusedA

Registered User.
Local time
Today, 05:22
Joined
Jun 15, 2009
Messages
101
I'm working on creating a query based on another query that simplifies results into yearly records from monthly (so that all records of a given year will be shown as a sum).

What I have done is created a query with the fields that I need to have shown, including 'fldyear', in 'fldyear' i would like to have a criteria such as Like "*(inputboxresult)*" Where an inputbox is opened before the query and asks for the year required.

My input box works fine, it has simple code:
Dim strInput As String
Dim strMsg As String

strMsg = "Please Type Out The Year You Would Like To Search For (YYYY)"
strInput = InputBox(Prompt:=strMsg, title:="Year Search")

I am just missing the line to place the strinput into the criteria for the 'fldyear' field.

Something like:
DoCmd.Insert strmsg into querysbjyear.fldyear.criteria
Help would be appreciated.

Thanks,
ConfusedA
 
Im not totally sure if queries would be the same but I would assume so. What i do when limiting fields in reports is when opening it you present your information.

DoCmd.OpenReport [form name here], acViewReport, , [WHERE stipulation here]

in the WHERE stipulation you would put something like "fldyear= " & strinput


Anyway thats my suggestion... keep in mind im still relatively new to VBA as well so good luck!
 
Ok, I'll try that. Thanks!
 

Users who are viewing this thread

Back
Top Bottom