Please help

  • Thread starter Thread starter gabo
  • Start date Start date
G

gabo

Hello guys, 2 days ago I was asked by a customer to design his database in MS
access however vba isn't my strong arm, and I haven't been able to do many
things I that were really easy to achieve(if it was a php app):
for instance:
I have a table called competencies, this table contains all requisites that
someone needs to have for a given position within the company.
I need to loop through this table and display on a form all the competencies
regarding each specific position.
as an example, lets say that Mark Taylor is the company's manager the
competencies for this position are -> Math skills, computer skills, ability
to read, and jugdment.
since the table contains many other competencies such as ->computer
programming, weapons training, etc. that have nothing to do with his role, I
only want to display the ones that concern him. how do I do that?!!
any help with this will be greatly appreciated, thanks advance.
 
gabo said:
Hello guys, 2 days ago I was asked by a customer to design his
database in MS access however vba isn't my strong arm, and I haven't
been able to do many things I that were really easy to achieve(if it
was a php app):
for instance:
I have a table called competencies, this table contains all
requisites that someone needs to have for a given position within the
company.
I need to loop through this table and display on a form all the
competencies regarding each specific position.
as an example, lets say that Mark Taylor is the company's manager the
competencies for this position are -> Math skills, computer skills,
ability to read, and jugdment.
since the table contains many other competencies such as ->computer
programming, weapons training, etc. that have nothing to do with his
role, I only want to display the ones that concern him. how do I do
that?!!
any help with this will be greatly appreciated, thanks advance.

No table-looping. Use a query or filter. Open the query designer, add your
table, pull down the fields you need and then apply criteria to the ones
appropriate to get the records back you want.

If your form is based on this table all you have to do is apply an appropriate
filter.
 
Gabo,

This will obviously be dependent on your table design. That said, the basic
principle is to use a subform to display this information. On the main form
you'll have the general employee information (name, address, title,...) then
you'll link a subform to the main form to display the specific employee
related skills. When you create a subform you have to create a link, this
will in effect filter the records displayed and thus you will only see those
related to the employee that is in the main form.

you may also want to take a look at

http://www.functionx.com/access/Lesson27.htm

Hope this helps,

Daniel
 
First, for what you are trying to accomplish, you DON'T NEED ONE LINE of
code....
I only want to display the ones that concern him. how do I do that?!!

Well, the question would then be where do you "store" this list of
particular competencies?

I would think the "standard" approach would be to have a table called

MyListOfCompentances.

So, for each customer, you would relate the one table called
MyListOfCompentances to the customers table.

hence:

Customers main table
----> MyListOfCompentances - child table

now of course, that list we are going to enter for each customer could just
as well been a list of favourite colors. Because during data entry we want
to provide a "consistent" list of possible colors (or, in your case
competencies, then often you create a table that has the list of POSSIBLE
competences (this sounds like your list that you already have..but, you made
no mention of relationships yet).. This table of "possible" competences will
of course be used during data entry to make entering into the
"MyListOfCompetncaly" table very easy.

So, we have so far 3 tables

customers
MyListOfCompetances - child table fo cutomers (it is related to
customers)

tblcomptances - a table that simply lists the possible
list of competencies to make data entry easer for the user.
- this table is not really
related, but just provides a list of values for the above....
- if your users know the list by
heart, then during data entry we would not actually need this
table.


However, if you think about the above arraignment, there is not really a
enforced relationship from "MyListOfCompancltyes" to the table called
"tblCompentances"

however, we thus do in effect now have:

Customers main table
----> MyListOfCompentances - child table
-----> tblCompeanteces - lookup table of allowed
competences.

So, the way to build this is to build a main data entry form. This form will
allow you to edit the customers. You then add a sub-form to this main form,
and this would be based the MyListOfCompantynes table. A continues form
would likely look quite nice.

and, to save the person the "pain" of having to type in, or "remember" what
competencies are legal, then you would use a combo box in that continues
form (our MyListOfComapceys sub-form). That combo box would "list" from
tblCompenateces, but STORE its value in MyListOfCompentances.

All of the above in ms-access can be done simply using the mouse...and drag
and drop..and so far NOT ONE line of code need be written.

note that as you navigate through customers, ms-access will automatically
populate the related records in the sub-form for you......

You don't need code, and can do all of this via drag and drop with the
mouse. In php...you have to write both a whack of code for updating, and
even more worse of whack of code to update and display the child records.
Likely 10-50 times more work then in ms-access..and with ms-access you don't
even need to write ONE line of VBA code here at all.....
 

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

Back
Top