Field allowing entry Pls HELP!!

J

JB

Hi, I've now got myself in a total muddle.

I've created a database that worked very well.
The usual client and contacts etc. the main form had fields for the main
contact and one for second.
But a couple of the users asked to be able to add up to 4 contacts.
I didn't want to clog up the table or take up all the room on the main
Client form so i moved the contact fields from the client table to a new
table 'contacts' and I created another form to enter all the contacts,
firstname, lastname, position, phone and email etc which the user can access
by a command button, 'add/view/edit contacts'.

This is what I've got
tblClients
tblContacts
qryClientContact which takes fields from tblClients and tblContacts
including ClientId and ContactId
frmClients whose control source is qryClientContact
frmContact whose control source is qryClientContact

This works ok. we can open the Contacts form and add new and edit contacts,
BUT when we go to Add a new Client in the main Client form, all sorts of
things are happening.

We type in the client name and then we open the frmContact, you can place
the cursor in all the fields but can't enter anything. there's no message or
anything. Back in the main form when I go from the last field before the
Subform I get the debug message and when i go into the code it shows:

Private Sub Form_AfterInsert()
Me!Clientfind.Requery
Me!Clientfind=Me!ClientName
End Sub

When I go back to the main form, the client field is bland as though i never
entered anything.
When you do a search in the form (command available) or when I run the query
qryClientContact, there is no record of the new entry at all.
But if you go to tblClients, it's there. ??

I've missed something but for the life of me can't see it.
I hope all this makes sense. sorry it's so long but I'm new to all this.
Jenny
 

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