Editting/Deleting using Subform

kevygee

Registered User.
Local time
Today, 02:27
Joined
Jun 7, 2005
Messages
32
I currently have a form that contains a subform. The common many to many relationship that many subforms represent. The problem I'm having, is I want the user to be able to add, delete, and edit entries using the subform.

I just added the subform and add/edit functionality was not the default. The default for my subform was that no editting or additions were allowed. I could only view the information in the subform. I looked at the properties and all the fields I expected were correct (for example, Allow Additions was yes, Allow Edits was also yes, etc). I'm not sure why it's not letting me edit any of the fields.

More about the nature of the relationship. There are people, and each person can use applications. So there are two tables, People and Applications. This needs to be a many to many relationship, so there is a table, peopleJoinApplications, that joins a personID and an applicationID. The form is a person, and the subform is the list of applications related to this person.

I'm looking for a good way to allow users to add an application to a person, and to delete the relationship between a person and an application. Any ideas?
 
Okay, I have sort of found a way to overcome this problem (at least from the time being, some suggestions would still be greatly appreciated) and I've encountered another problem.

When a button is pressed, an SQL statment is run to insert a new piece of data based upon a combobox. The information is successfully inserted via the sql statement, but I can't get the subform to update with the new information. Here's my code:

Code:
Dim appRS As Recordset
Dim curDB As Database

Set curDB = CurrentDb
Set appRS = curDB.OpenRecordset("subFormQuery")

appRS.Requery
appRS.Close

So I'm trying to requery the query that the subForm is based on (subFormQuery), which requires a recordSet object. Any ideas on what I need to do to make the subform refresh after the button is pressed let me know.
 

Users who are viewing this thread

Back
Top Bottom