By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 2,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

Data in Index form

P: 22
I want to make index view of phone direcotory i.e. on a single form there are buttons from a to z.
I hav make separete queries that shows results start from A, B respectivly.

But how i can handel these queries on single form i.e. when i click A it run qery A and display corresponding records.when B.....so on

Thx
Oct 27 '06 #1
Share this Question
Share on Google+
12 Replies


100+
P: 106
I want to make index view of phone direcotory i.e. on a single form there are buttons from a to z.
I hav make separete queries that shows results start from A, B respectivly.

But how i can handel these queries on single form i.e. when i click A it run qery A and display corresponding records.when B.....so on

Thx
One option is to create queries.
for query A, set your criteria for qurery A.
same for the rest of the queries
display each query in a form (A,B,C,....)

Then in the form, create buttons (A, B, C, D,etc.....)
Private Sub A_Click()

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "formA"
DoCmd.Openform stDocName, , , stLinkCriteria

End Sub

Or you can do it dynamically,

Cheers
Oct 27 '06 #2

P: 22
These indexing i want to do in a single form, rather than open seprate forms for each buttons.
Oct 27 '06 #3

100+
P: 106
These indexing i want to do in a single form, rather than open seprate forms for each buttons.
I have never done it myself and I don't have code for it but I think you can create few variable for each of your text boxes that you want to display information, and run sql statement and display those information in the text boxes for each of the button.

hope it helps
Oct 27 '06 #4

Expert 5K+
P: 8,434
Is the code in Access, or standalone VB?
Oct 27 '06 #5

P: 22
i m using MS access, in which vb coding facility available.
Oct 27 '06 #6

PEB
Expert 100+
P: 1,418
PEB
Hi,

So you can change the recordset property of your form..

In your A click even procedure you can write

Me.recordset=AQuery

And so on..

:)
Oct 27 '06 #7

PEB
Expert 100+
P: 1,418
PEB
Pardon

Me.recordset="AQuery"

;)
Oct 27 '06 #8

Expert 5K+
P: 8,434
Hi,
So you can change the recordset property of your form..
In your A click even procedure you can write
Me.recordset=AQuery
And so on..
:)
Wouldn't it make more sense to use a single query, and pass the letter as a parameter? Or insert it into the query dynamically? Having 26 separate queries seems cumbersome.
Oct 28 '06 #9

PEB
Expert 100+
P: 1,418
PEB
Wouldn't it make more sense to use a single query, and pass the letter as a parameter? Or insert it into the query dynamically? Having 26 separate queries seems cumbersome.
Sure that it's better!

However if he has done 28 queries, why to say that his work isn't usefull?

:)
Oct 28 '06 #10

P: 22
This all thing I can manage, But i need some usful functionality on from to get the result from 26 queries when click on correspond buttons. What function should i use??
Oct 29 '06 #11

NeoPa
Expert Mod 15k+
P: 31,492
This all thing I can manage, But i need some usful functionality on from to get the result from 26 queries when click on correspond buttons. What function should i use??
??!???!???
Oct 29 '06 #12

PEB
Expert 100+
P: 1,418
PEB
Hey,

On click property of the respective bouton you choose event procedure...

If you visualize in subform datasheet your query type

Me![Your Subform].Form.recordset="AQuery"

Change Your Subform with the name of your subform
"AQuery" with the name of your query that invokes the names with A

And all this for the buton A the same thing for the others butons

:)
Oct 29 '06 #13

Post your reply

Sign in to post your reply or Sign up for a free account.