SubForm Problem

  • Thread starter Thread starter scottr
  • Start date Start date
S

scottr

Guest
Could anyone please assist me with a problem I am having with subforms.

I have a main form with two subforms. The first displays several fields in datasheet view of the underlying table.

The second subform shows the remaining fields of the same table in form view so that when the record is selected in the first subform, the remaining fields are displayed in the second.

Unfortunately I cannot get the second subform to display the remaining fields?

Both subforms use the same recordsource.

Thanks

Scott
 
Just for clarification, why do you have two subforms if they both pull from the same recordsource?
 
The first subform in Datasheet view gives the user a snapshot view of the record, showing the first three or four fields.

The second subform displays the remaining fields once the record has been selected form the first subform.

Scott
 
So the problem is you have too many subform fields to fit into the space allocated them? Are you using a continuous subform for the first subform and a single form view for the second, I'm guessing?
I think you're doubling that part of your overhead by pulling the records twice, but I'm not sure. Look up the Requery Method (VBA) and how to refer to a subform from another form. You probably have to Requery the second subform in the OnCurrent event of the first subform.
 
Yes that's where I'm stuck.

Subform 1 = adocdisplay
Subform 2 = detailbox

The second subform is linked back to the first by [adocdisplay].Form![docid] being set as the Master field.

The first subform has set for the OnCurrent event

Me.Parent![detailbox].ReQuery

The first subform is set to "Datasheet" and the second to "Single Form"
 
Try:

forms!frmMainForm.Form.subSubForm2.requery


where frmMainForm is the name of the subforms' parent form.

and

where subSubForm2 is the name of the second subform (detailbox I think).

-Mark
 
Thank you to those who replied. I have re-assessed the problem and have removed the 2nd subform and replaced it with unbound fields.

The On click event of the first subform populates the unbound fields with the appropriate record while the double click opens the edit form.

Much easier!

Scott
 

Users who are viewing this thread

Back
Top Bottom