Subform and Multiple Phone Numbers

C

Cameron Piper

I am working on an access 2002 database on a microsoft
Office and Windows XP based machine.

There are three tables in my question:

1. tblphones
PhoneID: Primary Key, Autonumber
Other Fields

2. tblclient
ClientID: Primary Key, Autonumber
Other Fields

3. tblPhoneRelationship
ClientID: Linked to tblClient
PhoneID: Linked to tblPhones
RelationshipID: Primary Key, Autonumber

frmClient:
I have client form that I am using and on that form I
want to put a command button that will open another phone
where I can enter phone numbers for that client
(frmPhone). Linked to tblClient

frmPhone:
This form contains a subform set to continuous view
(frmPhoneContinuous). The only information stored on
this form will be a couple of non-question related
command buttons.

frmPhoneContinous:
Linked to tblPhone, will be where I enter the information
for the phone numbers.

Will someone please help me link these forms so that when
I open them, I will see the information from the client
that I was viewing. Translation: When I open frmPhone, I
want to only see those phone numbers that are related to
client on frmClient upon which I was working.

I tried linking the tables directly and storing the
clientID with the phone number, but was having many
problems with errors upon entry. I broke up the tables
into a one to many and many to one relationship in order
to avoid these problems, but am at a loss for how to link
the two forms together.

Do I need to base the information on a query?

A nudge in the right direction would certainly be
appreciated.

Cameron Piper
(e-mail address removed)
 
G

Greg Kraushaar

Why not just Drop frmPhoneContinuos directly on frmClient as a SubForm
Set the Master-Child properties for the subForm appropriately

If you must open the form separately, & I can think of several valid
reasons to to do this,

Pass the ClientID as an OpenArg to the New form
Use that value to dynamically filter the records on the new form (or
better rewrite the RecordSource)

HTH
Regards Greg Kraushaar
Wentworth Falls Australia
(Do not email - the reply address is a Spam spoofer)
(If you really must, remove all UCase and numbers)
 
G

Guest

Hi Cameron,

a question, why don't you put frmPhoneContinous in a subform on frmClient?. This way when you view your Client data it will also show you their phone. Just put ClientId on the Master/Child Link Property of the subform.
In the frmPhoneContinous, you can use dropdown control (set its Row Source property to tblphones, set Limit To List = YES and trap Not In List Event for new phone# that is not exist in tblphones), to enter client phonenumber.

Hope this help.

----- Cameron Piper wrote: -----

I am working on an access 2002 database on a microsoft
Office and Windows XP based machine.

There are three tables in my question:

1. tblphones
PhoneID: Primary Key, Autonumber
Other Fields

2. tblclient
ClientID: Primary Key, Autonumber
Other Fields

3. tblPhoneRelationship
ClientID: Linked to tblClient
PhoneID: Linked to tblPhones
RelationshipID: Primary Key, Autonumber

frmClient:
I have client form that I am using and on that form I
want to put a command button that will open another phone
where I can enter phone numbers for that client
(frmPhone). Linked to tblClient

frmPhone:
This form contains a subform set to continuous view
(frmPhoneContinuous). The only information stored on
this form will be a couple of non-question related
command buttons.

frmPhoneContinous:
Linked to tblPhone, will be where I enter the information
for the phone numbers.

Will someone please help me link these forms so that when
I open them, I will see the information from the client
that I was viewing. Translation: When I open frmPhone, I
want to only see those phone numbers that are related to
client on frmClient upon which I was working.

I tried linking the tables directly and storing the
clientID with the phone number, but was having many
problems with errors upon entry. I broke up the tables
into a one to many and many to one relationship in order
to avoid these problems, but am at a loss for how to link
the two forms together.

Do I need to base the information on a query?

A nudge in the right direction would certainly be
appreciated.

Cameron Piper
(e-mail address removed)
 

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