want show result in spread sheet, in the form

N

naveen prasad

Hi all,

I have a form with a combo box , listed with 5 items.

when each item is selected it will execute a query and result will in spread
sheet window like how normally appears when a query is executed.

but I want to add some thing like spread sheet, in the form at the bottom.

when a query is executed the result should appear in the bottom attached
spread sheet.

pls help me here in 2 things.

1. where and what should i add at the bottom which seems like spread sheet
and how to add it.

2. how to make possible the result will appear on it.

thanks in advance....
 
D

Daryl S

Naveen -

You can create a form that is based on your query. Then you can add this as
a subform to your main form, and set it to display in datasheet mode.
 
N

naveen prasad

dear i have created form based on query , and pressed f11 and added the form
to the main form.

but not worked.. kindly explain how to add as a subform , ie child -master
relation

pls help
 
D

Daryl S

Naveen -

The answer will depend on your main form and how its recordsource is related
to the combo box.

If your combo box is bound to a field, then choose that field for the Master
record link. For the child record link, choose the field that matches that
field in the main form's combo box.

If the combo box on the main form is not bound, but there is a field for
this item in the table/query that is the recordsource for the main form, then
the master link field should be this field, and the AfterUpdate event of the
combo box needs to populate this field with what was chosen.

If your main form does not have a record source, or there is no field in the
recordsource to hold the chosen data from the combo box, then you do not need
to link the subform to the main form. Instead, the recordsource in the
subform should have the criteria based on the data in the combo box on the
main form. You will then need to requery the subform in the AfterUpdate
event of the combo box on the main form.

You will need to give us more details on your form, subform, and the
recordsources if you need more help.
 
N

naveen prasad

dear i will give clear information kindly help me

In the form F1 has only a combo box is created, with recordsource "select
distinct mobile_no from t1 order by mobile_no.

now the combo box combo1 has all the mobile numbers of T1.

Table T1 as fields contact_name, age, sex, mobile_no,location.

queries created q1

q1 = select t1.name,t1.age,t1.location where t1.mobile_no = forms!f1!combo1;


now in the combo1 click properties

private sub combo1_click()

Dim stDocName As String


stDocName = "q1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

end sub


now when we select a mobile number in the combo1 each time query will be
executed and will display result,
the problem is always i need to close the result window and again select
another mobile number,

what i want is some thing like spread sheet should be fixed to the form ,
and the result should appear on it.

how can i do it....

pls help
 
N

naveen prasad

i have made it ...
thanks....

naveen prasad said:
dear i will give clear information kindly help me

In the form F1 has only a combo box is created, with recordsource "select
distinct mobile_no from t1 order by mobile_no.

now the combo box combo1 has all the mobile numbers of T1.

Table T1 as fields contact_name, age, sex, mobile_no,location.

queries created q1

q1 = select t1.name,t1.age,t1.location where t1.mobile_no = forms!f1!combo1;


now in the combo1 click properties

private sub combo1_click()

Dim stDocName As String


stDocName = "q1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

end sub


now when we select a mobile number in the combo1 each time query will be
executed and will display result,
the problem is always i need to close the result window and again select
another mobile number,

what i want is some thing like spread sheet should be fixed to the form ,
and the result should appear on it.

how can i do it....

pls help
 

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