Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2005

Tip: Looking for answers? Try searching our database.

Help with code joining two criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 31 Jul 2005 00:46 GMT
Private Sub GetEIDDate_Click()

Access 2000.  I'm trying to get this code to work by joining [EID] and
[Current_Date] below.  I have two textboxes and a cmd button, hoefully will
send my form to the record with the two criteria selected.,Thanks...Randy

Dim lngLen As Long
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Current_Date] = #" & Format(Me![txtDate], "mm\/dd\/yyyy") &
"#" _
& "# And [Eid] = " & Str(Me![txtEID])
' Find the two records ([EID] and [Current_Date] that matches the control.
Me.Bookmark = rs.Bookmark
End Sub
Van T. Dinh - 31 Jul 2005 10:26 GMT
You got 2 hashes (##) after the explicit date value after the Strong
construction.

Try (if [EID] is Numeric)

rs.FindFirst "[Current_Date] = " & Format(Me![txtDate], "\#mm/dd/yyyy\#") &
_
   " And [Eid] = " & Str(Me![txtEID])

If [EID] is a Text Field:

rs.FindFirst "[Current_Date] = " & Format(Me![txtDate], "\#mm/dd/yyyy\#") &
_
   " And [Eid] = '" & Str(Me![txtEID]) & "'"

Signature

HTH
Van T. Dinh
MVP (Access)

> Private Sub GetEIDDate_Click()
>
[quoted text clipped - 12 lines]
> Me.Bookmark = rs.Bookmark
> End Sub
Randy - 31 Jul 2005 14:20 GMT
Thanks Van, that was it...Randy

> You got 2 hashes (##) after the explicit date value after the Strong
> construction.
[quoted text clipped - 28 lines]
>> Me.Bookmark = rs.Bookmark
>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.