Programming with Macro

krish

New member
Local time
Today, 20:07
Joined
Jan 11, 2008
Messages
5
I have inserted two combo box in the form with lookup in the table. Now I want to select values in these boxes and filter the records having those values on click of a command button placed on the form.

How can it be done without using VBA? Is it possible with use of macro?

Kindly guide.
 
Can you explain the situation a little more? VBA is a little scary at first but with a little practice you will find that it is very versatile and allows you to do things that macros or wizards will never allow. If for instance you have a form and the values in the combo boxes together represent the filter values you can say:
docmd.openform "form name",,, "Subject.[Subject Record ID] = [Combo3]

This would allow you to put a unique identifier in the combo box and then have that be the criteria for the form's results. Post your combo box names and their values and I'll see if I can give you a hand,
Tyler:)
 
Programming with macro

Can you explain the situation a little more? VBA is a little scary at first but with a little practice you will find that it is very versatile and allows you to do things that macros or wizards will never allow.
Tyler:)

I have created a test database to find out how this can be done. It contains a table EMPDTL which contains fields EMPFNM, EMPMNM, EMPLNM, EMPPOST, EMPSAL indicating Employee's First Name, Middle Name, Last Name, Post Held and Salary respectively.

I have placed four combo boxes EMPFNM, EMPMNM, EMPLNM, EMPPOST looking up to the corresponding fields in the table and a command button Command10. I would like to select values from the above four fields and then click the command button to filter the record containing the value. However, relationship between the four fields in the table needs to be maintained in the form.

How to achieve this? Whether it can be done by macro?

Krish:)
 

Users who are viewing this thread

Back
Top Bottom