Question Need sample mdb adding to listbox/subform

josephbupe

Registered User.
Local time
Today, 16:44
Joined
Jan 31, 2008
Messages
247
Am looking for a sample mdb that illustrates how to add records stored in one table to another table through a list box /subform by selecting from a drop down list or a listbox.

Any record should be not added more than once; i.e if it was added already a msgbox will pop up to alert the user..


I will appreciate your kindness.
 
Okay John, you're very right.

What I need actually is a way to link through a listbox/subform names of associates stored in one tblAssociates to names of suspects in tblSuspects with the help of a combo box. So, any associate must not be linked to a suspect more than once.

Could there be a sample that I can easily adopt?
 
Last edited:
I'm currently not on a computer with Access, so I can't give you a sample.

One way to do this would be to have a table called, say, TBL_Associations, in which you store SuspectID in one field and then AssociateID in the other, you could populate this using a popup form that is populated bu a query that uses the current SuspectID as a query and then allows you to select from a list of all Associates not already link to that SuspectID.

This table could then be used to populate your sub form that shows all known associates for a particular suspect.
 
Hi David,

Thank you so much for the sample. That is what I was looking or, but please more help.

Am trying to replace TBL_Employees with tblPersons and added into it a field as yours 'fldFlags' but am still maintening tblSampleData.

However, on my form when I drop down combo and select person name and error appears "Type mismatch error"
which points me to the last part of the following code in the After update of the combo:

....
nIndex = 1
strFlags = Me.CboEmployees.Column(2)
Set Rs = CurrentDb.OpenRecordset("tblSampleData")
Do Until Rs.EOF
bFlag = Mid(strFlags, nIndex, 1)

....

Please, see the attached mdb for me. I will appreciate.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom