Results 1 to 2 of 2

Thread: Query Help

  1. #1
    Join Date
    Nov 2002

    Unanswered: Query Help

    Hi All:
    here is my code.

    If initiate = True Then
    SQLStmt = "Select [Work Order ID] from [Inventory WorkOrder] where [Work Order ID]=" & ID
    Debug.Print SQLStmt

    DoCmd.OpenForm "yworkOrder2", acNormal, , SQLStmt
    End If

    I am trying to open yworkOrder2 form with specified ID number.Id number is held in ID global variable. it doent give me any error message in SQLSTmt ..but it gives me erro'3075' when i try to access that query in DOcmd.openform statment.
    any help will be appreciated .thanx in advance.

  2. #2
    Join Date
    Dec 2001
    You don't need to put the whole SQL statement in the OpenForm method "WhereClause" parameter, just the Where Clause. Try this:

    docmd.OpenForm "",acNormal,,"[Work Order ID] = " & ID

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers

Posting Permissions

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