Subforms help

mapat

Registered User.
Local time
Today, 15:13
Joined
Feb 2, 2007
Messages
176
Hello,

I have a main form and in it, I have 2 subforms (subformA, and subformB next to each other) which are both linked to the same table. SubformA shows only 2 table fields and is seen in Datasheet View, and SubformB has basically all the table fields and is shown in Form View.

When I double click on a specifc record on SubformA, I want that record to be shown or loaded on SubformB. There is an integer "ID" field in both subforms (or in the main table). How do I do this?

Thank you very much everyone
 
HI,

I think I would use subformB as a subform of subfpromA.

If you can't, an other way around this:
1. Make soure SFA has the ID field (even if it hiden).

2. Have a public method on SFB that receivs an ID Value, and finds the record. You can use the docmd.FindRecord method, just be sour to first set focus on the ID field in SFB. Make soure the ID field in SFB is not hiden, so that it can be in focus:
Code:
Public sub findID(id as long)  
    Me.ID_FieldName.SetFocus
    DoCmd.FindRecord id
end sub

3. Have the double click event send the record ID to AllForms!subformB!findID(ID)

4. If doesn't work, try sendig the record ID to a public sub in a module, and have it call AllForms!subformB!findID(ID).

Good luck!
 

Users who are viewing this thread

Back
Top Bottom