Wrox Programmer Forums
|
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 9th, 2007, 06:29 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with Unbound Date field to link with SQL VBA

I am busy setting up a find/filter and sort feature for a table that will have a lot of data, in three months up to 2500 entries. I have used the SQL functions as described from page 420 in the Book. Of the nine filter field I have 8 are working with out a problem. In the main table (ACCOUNTS) I have a field called TRADATE set as Short Date. In the Filter query the same field exits. In the form I have an Unbound txtTID field set to short date format. The VBA and Sql is modified form page 422-427.

I have tried using the code for strings and for numerics but i have had no luck i keep getting an empty table as my result.
the code attached to the after update field is as follows

Private Sub txtTID_AfterUpdate()
On Error GoTo Error_Handler

SelectRecords
txtTID.Requery

Exit_Procedure:
On Error Resume Next
Exit Sub
Error_Handler:
MsgBox "An error has occurred in this application. " _
& "Please contact your technical support person and tell them this information:" _
& vbCrLf & vbCrLf & "Error Number " & Err.NUMBER & ", " & Err.DESCRIPTION, _
Buttons:=vbCritical, title:="My Application"
Resume Exit_Procedure
Resume
End Sub



the code attached to the selectrecords function is as follows

If Not IsNull(txtTID) Then
varWhereClause = (varWhereClause + strAND) & _
"qryFilterLedgerExpenses.TRADATE = " & Me!txtTID
End If
I thinks there is something wrong with my syntax so any help would be appreciated

In the VBA watch window I found that the date ends up with a " mark and hence no data is found.





Similar Threads
Thread Thread Starter Forum Replies Last Post
unbound field in subform chacquard Access VBA 4 February 7th, 2007 10:01 AM
unbound field in a form zanza67 BOOK: Access 2003 VBA Programmer's Reference 0 September 3rd, 2005 01:46 PM
Unbound field lee27 VB Databases Basics 1 January 5th, 2005 07:53 AM
How to bind unbound field ? cjordan BOOK: Professional Crystal Reports for VS.NET 1 January 23rd, 2004 01:34 PM
Date in Access VBA (SQL) Kenny Alligood Access VBA 2 September 14th, 2003 08:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.