Query input capture

Smee

Registered User.
Local time
Today, 03:23
Joined
Dec 16, 2003
Messages
69
Hey guys

I have a query that is fed a year period number (eg 200303) by the user and works from that. This query is then tied to a form and the form displays the results.

Is there away to also put the year period entered into the query on the form so I can use it later.

i.e query requests yr prd :-
Code:
>=[Enter Year Period - eg 200304]

Where does this go, and how do I use it?

Thanks
 
Smee said:
Is there away to also put the year period entered into the query on the form so I can use it later?

i.e query requests yr prd :-
Code:
>=[Enter Year Period - eg 200304]

Personally, I prefer to put two textboxes on a form with a pop up calendar attached so that the user can select any date range they wish and are not restricted to specific years, months, or days.

If you are storing the year period as a field in your table i.e. 200304 then I'd suggest against it and just use a data as normal as, in a query, you can change the date to the format you want temporarily (i.e. Format([MyDate], "yyyymm") )

However, as you only want to reference the form. In the query you just put a reference to it like so:

[Forms]![MyForm]![MyTextBox]
 
Incredibly fast answer but not quite the problem I tried to write down. I'll explain a bit more.

The Yr_prd is something we can't change at the moment. It comes from a Foxpro database store that is very 'resistant' to change, and in this case the format of the yr prd is unchangable.

The yr prd itself is the year (as you spotted) but the last 2 digits aren't mm, but the number of 2 week periods into the year. i.e. 26 in a year, roughly 2 periods per month. So 200326 would be the last 2 week period of 2003, roughly 16th Dec - 30th Dec (something like that).

I ask the user to input the desired yr_prd and then it selects all jobs that have been worked on since that yr_prd using the timesheet table (also imported from the foxpro).

For some code later on I need to know what yr_prd the user input into the query, so what I hoped was I can capture it when it is input, without having to create a seperate form, which they input the yr_prd into, and then I pass that to the query.
 
Same problem again.

The query asks for a year period and the form displays the result.

I need to capture what the user inputs so I can use it.

Is there a way?

If the answer you gave before is the same then I didn't understand your answer.

I want to do the equivilent of me.mytextbox = userinput.value

Thanks
 

Users who are viewing this thread

Back
Top Bottom