Show Contact Name Unique to Supplier

scouser

Registered User.
Local time
Today, 11:28
Joined
Nov 25, 2003
Messages
767
I have been plodding along slowly building up a small DB and have hit a slight snag (or 2).

I have a Supplier Form (frmSuppliers). I have a frmSupplierContacts.
I want to prevent users entering data in the standalone frmSupplierContacts?

Also on frmPurchaseOrders I have a combo ContactID. I want the combo to display Supplier Contact Names for the selected supplier only.

I have put as row source:
Code:
SELECT tblSupplierContacts.ContactID, [LastName] & ", " & [FirstName] AS Contact FROM tblSupplierContacts WHERE (((tblSupplierContacts.SupplierID)=Forms!frmPurchaseOrders!SupplierID)) ORDER BY [LastName] & ", " & [FirstName];

This displays a Contact Name, but does not change if you select a different supplier?

Hopefully attached DB will explain all.
Thanks for any help in advance.
Phil.
 

Attachments

i have update both of the tables with want you wante, but to know what i have done its quite simple, in the frmSupplierContacts i changed Allow additions to "No"

In the other form I added contactID.requery to the afterUpdate procedure of the SupplierSelection combo box

Hope this helps.
 

Attachments

Last edited:
Cheers

Thanks for doing that. I was nealry there on the contactID combo.

Regards locking the frmSupplierContacts this doesn't do what I am after (should have explained myself better).I want the user to be able to enter Supplier Contact Names via frmSuppliers.

If frmSupplierContacts is opened as a standalone form then I do not want users to be able to add contact names as they would not be relative to a supplier. (does that make sense?).
Cheers,
Phil.
 
It does make sense.

OK here what to do in the form "frmSuppliers" add the following code: -

Code:
Private Sub Form_Load()

Me.frmSupplierContacts.Form.AllowAdditions = True

End Sub

If you have changed the form frmSupplierContacts allow additions back to Yes then change it to No.

So when the frmSupplierContacts form is open up on its own a user can not add any data, but if its open up as a sub form then it can have data added.

Hope this is ok, and i have understood what you mean.

Kevin
 
Nice one

I will give that a whirl.....
Thanks,
Phil.
 
Spot On

Superb, just what I was looking for.
Many Thanks,
Phil.
 
Have a look at this sample (it's yours just a name change) .

Try and open the frmSupplierContacts ...........is this what you want to happen?
 

Attachments

Super!!

Thanks for that. That is exactly what I was looking for :D
Thanks to EVERYBODY that has had input on this one.
Cheers,
Phil.
 

Users who are viewing this thread

Back
Top Bottom