Results 1 to 4 of 4

Thread: [RESOLVED] Access VBA: "Run-time Error 2001"

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2004
    Posts
    48

    [RESOLVED] Access VBA: "Run-time Error 2001"

    Im getting an error with this bit of code:

    VB Code:
    1. Dim sForename As String
    2.         Dim sSurname As String
    3.         Dim sCode As String
    4.        
    5.         sCode = DLookup("staffCode", "booking", "bookingDate = #" & dDate & _
    6. "# AND timeID = " & timeID & " AND areaID = " & areaID)
    7.                
    8.         sForename = DLookup("[staffForeName]", "staff", "[staffCode] = " & sCode)
    9.        
    10.         sSurname = DLookup("staffSurName", "staff", "staffCode = " & sCode)
    11.                
    12.         MsgBox "The booking has already been booked by " & sForename & " " & sSurname

    Its screwing up on the "sForename = DLookup" line.... and the "sSurname = Dlookup" line

    Any help would be appriciated!!
    Last edited by c03cg; Jul 18th, 2006 at 09:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width