João serras-pereira
asked on
subform in ms/ccess does not display the correct query
On my app I need to tightly control the behaviour even for the user (it is a medical app) . So I do have a form and a subform and the subform is bound to a query which I open when I press a button.
This is (almost) working, but, when I change the record on the master form I would expect to run the query and have the query result correctly displayed on the subform.
I have checked the query and it displays the correct output (in the current test, a null record set).
But the subform that is displayed dos not change and is kept on the first master record. Whenever I change the master record, it never changes. What shall I do to refresh the subform ?
any help appreciated
This is (almost) working, but, when I change the record on the master form I would expect to run the query and have the query result correctly displayed on the subform.
I have checked the query and it displays the correct output (in the current test, a null record set).
But the subform that is displayed dos not change and is kept on the first master record. Whenever I change the master record, it never changes. What shall I do to refresh the subform ?
any help appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok
I'll try
My code is:
Me.frmExameLista.SourceObj ect = "frmExameLista"
Me.frmExameLista.LinkChild Fields = "frm_IDpaciente"
Me.frmExameLista.LinkMaste rFields = "frm_IDpaciente"
Me.frmExameLista.Visible = True
on the "on Current" on the master form...
But maybe I am wrongdoing and it is on the "current"
I'll try
My code is:
Me.frmExameLista.SourceObj
Me.frmExameLista.LinkChild
Me.frmExameLista.LinkMaste
Me.frmExameLista.Visible = True
on the "on Current" on the master form...
But maybe I am wrongdoing and it is on the "current"
ASKER
nope again
here is my code now:
Set q02_exameDef = LifeLingerDB.QueryDefs("q0 2_exame")
q02_exameDef.SQL = strSetSQL
Set q02_exameSet = LifeLingerDB.OpenRecordset ("tblExame ", dbOpenSnapshot)
frmExameLista.Requery
on the "on load" event, I do link child and master
on the button click, I have the above code...
the requery should work because frmExameLista depends on q02_exame... and q02_exam is alrigh!
here is my code now:
Set q02_exameDef = LifeLingerDB.QueryDefs("q0
q02_exameDef.SQL = strSetSQL
Set q02_exameSet = LifeLingerDB.OpenRecordset
frmExameLista.Requery
on the "on load" event, I do link child and master
on the button click, I have the above code...
the requery should work because frmExameLista depends on q02_exame... and q02_exam is alrigh!
ASKER
the above code os on the master form on a button..
ASKER
Found it
Thanks!
Repeated the code
Me.frmExameLista.SourceObj ect = "frmExameLista"
Me.frmExameLista.LinkChild Fields = "frm_IDpaciente"
Me.frmExameLista.LinkMaste rFields = "frm_IDpaciente"
Me.frmExameLista.Visible = True
frmExameLista.Requery
on the buttons and it works
thanks for the help
Thanks!
Repeated the code
Me.frmExameLista.SourceObj
Me.frmExameLista.LinkChild
Me.frmExameLista.LinkMaste
Me.frmExameLista.Visible = True
frmExameLista.Requery
on the buttons and it works
thanks for the help
ASKER
when I relate with the link field I am getting into a lot of trouble.
So I changed to this "manual" way; all I want noa is to force the refresh...