My problem is that after chosing an order from the list and open
a report, the form stays with the number of the customer for that number
and cannot be requeried.How can i clear the form?
This is my problem and to be more clear i will give more details
I have a form called F1. On that form i have a listbox called
ListOrders.When i select an order from the list, i open the report
called "invoice" for that order number.
My code is the following:
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "Invoice"
stLinkCriteria = "orderid = " & f![ListOrders]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
In the OnClose event of the report i have the following
code:
DoCmd.Close acForm, "F1"
DoCmd.OpenForm "F1", acNormal, "", "", , acNormal
Forms![F1].Requery
The control for the customer is called CustomerID.
So, if the order is given for a customer number 3, the number 3 appear
on the control CustomerID after i close the report.
I have tried with
f![customerid].requery
but with no results
I have also tried:
f!ListOrders.Value = 0
and
f![ListOrders].requery
but again with no result
I cannot understand why after closing and opening the form again
the form is not cleared from the previous results.
If i close the form by hand, and open it, then everything is OK.
Obviously it is my code somwehere that bothers me.
Is there any magic code that will solve my problems?
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!