Solved Record do not show up when requery but their saved

jgcns

New member
Local time
Today, 14:49
Joined
Dec 31, 2020
Messages
12
Good Evening all,

I'm facing a strange situation... I have a Form that opens and allow user to select some products. Then when they're finished, they close it and another form shows the request header and the selection. The problem is that the list of chosen items on this second form is always, one item less than the suppose.
If I requery again or close and open the form it shows all the selected items...

My code:
I have some trigger on the first form closure that requery the second one...

Private Sub Form_Close()

If Me![FormRequisitionBody].Form.Dirty Then

Forms.RequisitionBaseReq.FormRequisitionBodyviewonly.Requery
Forms.RequisitionBaseReq.FormRequisitionBodyviewonly.Form.Dirty = True

End If

End Sub

What am i doing wrong?

Ps.: I'm a newbie on access, but i'm focus on improovement.

Thank you,

Best regards,

João Santos
1609620662318.png

1609620694187.png
 
Firstly I'd see if that code even runs?
Secondly, why not just open the second form on closure of the first form?
 
Good evening,

Form description:

One form with requisition order header and Selected products ( general view)(second form) then you click to choose items and opens up another form with a seach engine that allow user to choose the items. This Search engine has code "on close" part (first one), ordering to requery General View.
And it actually does. Some of the items shows up on Gen View, but never the very last item. Only if i requery again.. ( the Gen view it is allways open)

do you have any Idea why this is happening?
 
your Don't test if it is Dirty or Not Dirty, just requery the form regardless.
 

Users who are viewing this thread

Back
Top Bottom