João serras-pereira
asked on
link subform to a dummey field in the master form
Hi -
On my app I need to show a list of records and, upon a record is selected, thus becoming the "current" record of the form I need to display the entire details.
The below screenshot demonstrates the sought output.
In order to implement this, I have a master form "mform" and 2 subforms, "sf1", with the list of records, so it is of type "continuous forms" and "sf2" containing the detailed info, of type "single form". "As such "mform" is unbound: the records are shown in SFI and their detail in SF2 - SF2 is bound t the master table from which SF1 records are displayed
My problem is that whenever a new current record in SF1 is selected, I should have a means of modifying the contents of SF2.
I have tried to link SF2 to a dummy field in MFORM containing the actual record key, but I am getting an error as ms/access thinks that the field name is a Parameter. Of course also I cannot bound the dummy field to the master table and bound MFORM to it - ms/access yields an error as it thinks that I am trying to modify the record key
what shall I do?
can anyone help?
On my app I need to show a list of records and, upon a record is selected, thus becoming the "current" record of the form I need to display the entire details.
The below screenshot demonstrates the sought output.
In order to implement this, I have a master form "mform" and 2 subforms, "sf1", with the list of records, so it is of type "continuous forms" and "sf2" containing the detailed info, of type "single form". "As such "mform" is unbound: the records are shown in SFI and their detail in SF2 - SF2 is bound t the master table from which SF1 records are displayed
My problem is that whenever a new current record in SF1 is selected, I should have a means of modifying the contents of SF2.
I have tried to link SF2 to a dummy field in MFORM containing the actual record key, but I am getting an error as ms/access thinks that the field name is a Parameter. Of course also I cannot bound the dummy field to the master table and bound MFORM to it - ms/access yields an error as it thinks that I am trying to modify the record key
what shall I do?
can anyone help?
ASKER
Hi
Could you elaborate just a bit?
I m scratching my head.
In the "current" on sf1 subform I have
The field
Forms!F110_ConvencoesFinan ciamentoMa ster!F110_ NumeroProj etoCorrent e
is the key in the master form, whichs correct
shall i do:
subformname.Form!PKname = Forms!F110_ConvencoesFinan ciamentoMa ster!F110_ NumeroProj etoCorrent e ?
Could you elaborate just a bit?
I m scratching my head.
In the "current" on sf1 subform I have
Private Sub Form_Current()
Me.F113_NumeroProjetoCorrente = Me.F113_NumeroProjeto
Forms!F110_ConvencoesFinanciamentoMaster!F110_NumeroProjetoCorrente = Me.F113_NumeroProjeto
If CurrentProject.AllForms("F91_LoggedUser").IsLoaded Then
Forms!F91_LoggedUser!F91_NumeroProjetoCorrente = Me.F113_NumeroProjeto
End If
End Sub
The field
Forms!F110_ConvencoesFinan
is the key in the master form, whichs correct
shall i do:
subformname.Form!PKname = Forms!F110_ConvencoesFinan
You don't need ANY code or at most, you might need to requery the subform from the list form's Current Event
Me.Parent.othersubform.Req uery
This is what the master/child link is designed to do - sync the child form to the current record of the master form.
Me.Parent.othersubform.Req
This is what the master/child link is designed to do - sync the child form to the current record of the master form.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Thanks!
I (thought I) had it that way. But started all over again and now it works!!!
I (thought I) had it that way. But started all over again and now it works!!!
sfrmEndorsementList.Form!E
so it is subformname.Form!PKname