Subform issue

poporacer

Registered User.
Local time
Today, 04:28
Joined
Aug 30, 2007
Messages
136
I have 2 tables (tblName and TblOffense) and a form with a subform (frmOffense and frmSubEdit) In the table (tblOffense) there are several entries for an offense and each offense will have an entry for each person involved.
i.e.:

Offense IDNumber charge decision
0001 p12345 244b denied
0001 q23456 244b accepted
0001 d13579 123c pending
0002 r12457 233f rejected

In the main form you select the offense number from a combo box (the combo box is populated from a DISTINCT query) The ON Change event then populates a second combo box with the ID numbers of the persons involved. I want the sub form to display and edit the data that pertains to the record selected. (Offense and ID number match) I have the subform bound to the Offense table. I can't figure out how to make the subform populate with the data. I am pretty sure I have to reference the subform and a bookmark and that by doing so, the changes made in the subform will change the table directly...So how do I get the subform to populate?
 
In the After Update event of the combo box, you need to requery the subform:

Me.YourSubFormCONTAINERNameHere.Form.Requery
 
??

Here is the database....The subform is not based on a query. It is linked to the table. I need to edit the data in the form. I can't figure how to get the data into the subform... Hopefully I am explaining myself better
 

Attachments

Here is the database....The subform is not based on a query. It is linked to the table. I need to edit the data in the form. I can't figure how to get the data into the subform... Hopefully I am explaining myself better

Doesn't matter whether it is based on a table or a query. In reality it is based on a query, regardless of what it LOOKS like to you. When you select the source as a table, Access is really going to use a query anyway. Same thing goes for when you open a table directly. When you do, you really are NOT opening the table directly, but a query that Access puts together in the background for you.

So, anyway, you will still need the requery. I WILL try to take a look but I'm not sure I'll have time for a while, so if you can actually try what I suggest, it might work for you and solve your problem quickly on your own.
 
I tried...not quite

I tried, but it didn't work...I did try to create parent child links but I am limited to 3 links...I have many more. With the links, it displayed the first record but did not change when a new number was selected. I will be waiting patiently....Thanks


Here is the new version with the change you suggested and the links.
 

Attachments

Users who are viewing this thread

Back
Top Bottom