Runtime Input to queries through form.

N

naveen prasad

Dear all..
Good day...
Kindly help me .

I have created a table d1.

d1 fields are date, r1,r2,r3,t1

r1,r2,r3 are numeric values
t1 is text

now i have created a query when executed asking date and t1,
In runtime values date and t1 will be entered.


Now what i want is , I have created a Form with calender , text box and a
button.

I will select the date, and enter the text and press the button.

Now these values should be input as date and t1 to my query and query should
execute.

kindly help me in this..
 
S

S.Clark

Assuming that the form is bound to the table, there is no need to click the
button to execute storing the values, as they will be entered directly into
the table.

If your form is explicitly unbound, then you can use an Append query to
store the values. Create a query, and change the query type to Append.
 
J

Jerry Whittle

Create an unbound form called frmParameter.

On this form put text fields [DateParameter] and [T1Parameter].

Next put a command button on the form that runs the query. A nice touch
would be to have the form also go invisible as it needs to stay open for the
report to run.

Now the magic part! Put the following as the query criteria for Date and T1
fields.

[Forms]![frmParameter]![DateParameter]

[Forms]![frmParameter]![T1Parameter]

You could even get fancy with things like a date picker, combo box, or list
of possible criteria from the tables in question.
 
N

naveen prasad

Dear thankyou for your response..

Here my problem is not to store my values in the table with append query

I only need the values which i give in form at runtime that values should be
input to query as date and text which will match with the existing table
values and give the required result.

for example , my query is

select * from d1 where date = x and t1 = y;

now x & y values i want to give runtime through form.


pls help me
 
N

naveen prasad

Dear thank you for you prompt response.

I am sorry to say I have not understood the complete concept which you
explained to me.

but i have taken a form added datepicker, and text box and a button which
executes query.


now what is happening is when run the form and press the button it is asking
me again the values x and y like same in query

select * from d1 where date = x and t1 = y;

I am not understanding how to give the values of x and y through datepicker
and textbox from form in runtime

like datepicker.value = x, textbox.text = y these i dont know how to
join these factors.

highly appreciated if you can explain in brief once again.
sorry to bother you dear .





as below

Jerry Whittle said:
Create an unbound form called frmParameter.

On this form put text fields [DateParameter] and [T1Parameter].

Next put a command button on the form that runs the query. A nice touch
would be to have the form also go invisible as it needs to stay open for the
report to run.

Now the magic part! Put the following as the query criteria for Date and T1
fields.

[Forms]![frmParameter]![DateParameter]

[Forms]![frmParameter]![T1Parameter]

You could even get fancy with things like a date picker, combo box, or list
of possible criteria from the tables in question.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


naveen prasad said:
Dear all..
Good day...
Kindly help me .

I have created a table d1.

d1 fields are date, r1,r2,r3,t1

r1,r2,r3 are numeric values
t1 is text

now i have created a query when executed asking date and t1,
In runtime values date and t1 will be entered.


Now what i want is , I have created a Form with calender , text box and a
button.

I will select the date, and enter the text and press the button.

Now these values should be input as date and t1 to my query and query should
execute.

kindly help me in this..
 
J

Jerry Whittle

You need something like below, with the proper form and field names in the
criteria of the query.

[Forms]![frmParameter]![DateParameter]
[Forms]![frmParameter]![T1Parameter]

select *
from d1
where date = [Forms]![frmParameter]![DateParameter]
and t1 = [Forms]![frmParameter]![T1Parameter];

Also this form should be unbound. That is it should not be linked to the
table in question.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


naveen prasad said:
Dear thank you for you prompt response.

I am sorry to say I have not understood the complete concept which you
explained to me.

but i have taken a form added datepicker, and text box and a button which
executes query.


now what is happening is when run the form and press the button it is asking
me again the values x and y like same in query

select * from d1 where date = x and t1 = y;

I am not understanding how to give the values of x and y through datepicker
and textbox from form in runtime

like datepicker.value = x, textbox.text = y these i dont know how to
join these factors.

highly appreciated if you can explain in brief once again.
sorry to bother you dear .





as below

Jerry Whittle said:
Create an unbound form called frmParameter.

On this form put text fields [DateParameter] and [T1Parameter].

Next put a command button on the form that runs the query. A nice touch
would be to have the form also go invisible as it needs to stay open for the
report to run.

Now the magic part! Put the following as the query criteria for Date and T1
fields.

[Forms]![frmParameter]![DateParameter]

[Forms]![frmParameter]![T1Parameter]

You could even get fancy with things like a date picker, combo box, or list
of possible criteria from the tables in question.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


naveen prasad said:
Dear all..
Good day...
Kindly help me .

I have created a table d1.

d1 fields are date, r1,r2,r3,t1

r1,r2,r3 are numeric values
t1 is text

now i have created a query when executed asking date and t1,
In runtime values date and t1 will be entered.


Now what i want is , I have created a Form with calender , text box and a
button.

I will select the date, and enter the text and press the button.

Now these values should be input as date and t1 to my query and query should
execute.

kindly help me in this..
 
N

naveen prasad

excellent thank you dear

finally i made.

thank you verymuch for your kind support


Jerry Whittle said:
You need something like below, with the proper form and field names in the
criteria of the query.

[Forms]![frmParameter]![DateParameter]
[Forms]![frmParameter]![T1Parameter]

select *
from d1
where date = [Forms]![frmParameter]![DateParameter]
and t1 = [Forms]![frmParameter]![T1Parameter];

Also this form should be unbound. That is it should not be linked to the
table in question.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


naveen prasad said:
Dear thank you for you prompt response.

I am sorry to say I have not understood the complete concept which you
explained to me.

but i have taken a form added datepicker, and text box and a button which
executes query.


now what is happening is when run the form and press the button it is asking
me again the values x and y like same in query

select * from d1 where date = x and t1 = y;

I am not understanding how to give the values of x and y through datepicker
and textbox from form in runtime

like datepicker.value = x, textbox.text = y these i dont know how to
join these factors.

highly appreciated if you can explain in brief once again.
sorry to bother you dear .





as below

Jerry Whittle said:
Create an unbound form called frmParameter.

On this form put text fields [DateParameter] and [T1Parameter].

Next put a command button on the form that runs the query. A nice touch
would be to have the form also go invisible as it needs to stay open for the
report to run.

Now the magic part! Put the following as the query criteria for Date and T1
fields.

[Forms]![frmParameter]![DateParameter]

[Forms]![frmParameter]![T1Parameter]

You could even get fancy with things like a date picker, combo box, or list
of possible criteria from the tables in question.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Dear all..
Good day...
Kindly help me .

I have created a table d1.

d1 fields are date, r1,r2,r3,t1

r1,r2,r3 are numeric values
t1 is text

now i have created a query when executed asking date and t1,
In runtime values date and t1 will be entered.


Now what i want is , I have created a Form with calender , text box and a
button.

I will select the date, and enter the text and press the button.

Now these values should be input as date and t1 to my query and query should
execute.

kindly help me in this..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top