Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Problem with Date 1

Status
Not open for further replies.

wdverner

Technical User
Mar 10, 2005
160
GB
Hi,
Im running a form that opens a pop up form and filters results. Main form gives Product Details, pop up form allows editing of price.

The main form has:

ProductID
Price
Effective Date

Pop up form opens this record for modification- it does this by taking the productid, price, date as criteria and then finding the appropraite record..


However i noted that sometimes the pop up form was blank, even though the record was successfully listed in the table.

If i took out the Date criteria it successfully filtered the record. BUT the date is important, as it was filtering any records that matched PorductID and price.

If i put the date in it doesnt find anything- BUT ONLY FOR SOME records!

For example it would not find Product 80056, Price 1.99, Date 01/08/2001. However if i changed the date to 12/08/2001 and left everything else the same, it successfully filtered to it.

If i change the date to 11/08/2001- it cant find it again....


Strange to say the least?! has anyone seen this happen before?!

Thanks!
 
confirmed- If the day of the date is LESS THAN 13 it wont find it... 12/08/2001- NO, 13/08/2001- YES

??????????
 
Use #yyyy-mm-dd# to remove ambiguity.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry PHV, can you elaborate on what you mean?

Thanks
 
Can you please post the code that launch the pop up form ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Dim strDocName As String
Dim strLinkCriteria As String

strDocName = "PriceListContentsubform"

strLinkCriteria = "SpareID = '" & Forms!Form2!Form1!SpareID & "' AND PriceList = '" & Forms!Form2!Form1!PriceList & "' AND EffectiveDate = #" & Forms!Form2!Form1!EffectiveDate & "#"

Exit Sub

 
... & "' AND EffectiveDate = #" & Format(Forms!Form2!Form1!EffectiveDate, "yyyy-mm-dd") & "#"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Definately worthy of a Star! Cheers PHV, you have again come up trumps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top