Hi All,
I am having problem regarding recordset.
I am working in MS Access and VBA.
I want to display records from the table(specific fields) depending upon the condition.
I am very new to this and never used recordset because i am a database programmer now i have to develop.
please suggest some coding about this.........

Hi Bikram,

When posting questions try and be a little more specific and include details such the version you are using and also and a little more about how the exact nature of the problem.

Anyhow, assuming your using Ms.A 2000 - 2003

Create a new query in design view and add the tables that you're drawing data from. If you're adding more than one table make sure the relationships are set up correctly.

Drag the fields that you want from the table onto the lower pane (you could also just select the table and fields in a lower pane by using the combo's)

Enter you criteria in the row marked 'Criteria' under the appropriate field (run the query to check all is well) and then save the query. You can then base you form or report, or even other queries, based on the query you've just created.

I know the answer is a little vague, but then you didn't give me much to work with.

Regards
RobinTheHood

hi Robin,
thanks for the advice but that was my first post.
Now i solved that problem but a new problem occurs in front of me....
I am having two list boxes. I choose some field from list1 in which fields are coming from table. I transfer selected fields from list1 to list2.
suppose List1 having values "Refno,Name,Loggeddate"
I select "Refno" and "name"
so list2 contains these two field.
I want only these two fields in the output.
how can i pass the selected items in query because sometimes i choose only two field and sometimes i choose all fields.

Hi Bikram,

When posting questions try and be a little more specific and include details such the version you are using and also and a little more about how the exact nature of the problem.

Anyhow, assuming your using Ms.A 2000 - 2003

Create a new query in design view and add the tables that you're drawing data from. If you're adding more than one table make sure the relationships are set up correctly.

Drag the fields that you want from the table onto the lower pane (you could also just select the table and fields in a lower pane by using the combo's)

Enter you criteria in the row marked 'Criteria' under the appropriate field (run the query to check all is well) and then save the query. You can then base you form or report, or even other queries, based on the query you've just created.

I know the answer is a little vague, but then you didn't give me much to work with.

Regards
RobinTheHood

This article has been dead for over six months. Start a new discussion instead.