By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,625 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,625 IT Pros & Developers. It's quick & easy.

Clear the form

P: n/a

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
DoCmd.Close acForm, "F1"
DoCmd.OpenForm "F1", acNormal, "", "", , acNormal

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
but with no results
I have also tried:
f!ListOrders.Value = 0

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 ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.