A form that has 2 clients from same table

G

Guest

Hi everyone
I have a "client" table and a "process" table.
Have to do a form called "procF" and i just want to insert 2 or 3 names from
same table "cliente" so it can show me all adress and contacts of those 2 or
3 clientes, beside all other data that as nothing to do with "clients" table.
I'm completly lost here. Any suggestions pls?
Tks in advance
Pedro
 
M

Michel Walsh

If your form procF is bound to your table 'process',

if your table process is cleaned each time the form opens (DoCmd.RunSQL
"DELETE * FROM process" )

after having appended a given number of records, in table process, through
your form procF, a query with an inner join would do the job you want:


SELECT client.* FROM client INNER JOIN process ON client.clientID=
process.clientID



which says: give me all records in table client that have a match in table
process, a 'match' being, here, defined when client.clientID=
process.clientID


To avoid duplicated result, you can add DISTINCT just after the keyword
SELECT:

SELECT DISTINCT client.* FROM client INNER JOIN process ON client.clientID=
process.clientID




Hoping it may help,
Vanderghast, Access MVP
 

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