Kamis, 27 Oktober 2011

[MS_AccessPros] What causes the value of a control missing

 

I have a form that runs a query. The form has 2 controls named txtCurrentDate, txtQtrDate. The date field in the query's criteria is based on the form's txtQtrDate control' value,
its value is like this : Me!txtQtrDate = DateSerial(Year(Me!txtQtrDate), Int((Month(Me!txtQtrDate) - 3) / 3) * 3 + 1, 0). The txtCurrentDate'value is set to =Date().
The query is like this: Select * from tblAssets as A Where A.dt = Me.txtQtrDate Order by A.dt;

Everything is working fine until no record was matched (err.Number 3021, No current record), when this happens, the txtCurrentDate on the form became blank. The txtQtrDate stays intact.
My code, the RunQuery procedure does not set it to Null or "", what causes the date missing??

Phucon

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar