Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Posts
    102

    Unanswered: Cancel Button on Parameter

    Ok here's a INSERT Statement

    INSERT INTO tblTmpOrders ( PONumber, PAR, CAB, SUB, QTY, HMMS, ItemDescription, DistributionUnit, UnitPrice, Total, NCC, DeptObj, MinObj, CostCtr, UnitCode, [Date], [Time], InventoryStaff, Barcode, ProcessingStaff, Notes, [Partial] ) SELECT tblOrdersHistory.PONumber, tblOrdersHistory.PAR, tblOrdersHistory.CAB, tblOrdersHistory.SUB, tblOrdersHistory.QTY, tblOrdersHistory.HMMS, tblOrdersHistory.ItemDescription, tblOrdersHistory.DistributionUnit, tblOrdersHistory.UnitPrice, tblOrdersHistory.Total, tblOrdersHistory.NCC, tblOrdersHistory.DeptObj, tblOrdersHistory.MinObj, tblOrdersHistory.CostCtr, tblOrdersHistory.UnitCode, tblOrdersHistory.Date, tblOrdersHistory.Time, tblOrdersHistory.InventoryStaff, tblOrdersHistory.Barcode, tblOrdersHistory.ProcessingStaff, tblOrdersHistory.Notes, No AS [Partial] FROM tblOrdersHistory WHERE (((tblOrdersHistory.PONumber)=[Enter the PO Number of the first PO]));


    Notice: the bold statement is inside a parameter that prompts the user for input..

    When the query is run it prompts the user to enter a PO Number. Either he/she enters the PO Number and hit OK or hit Cancel.

    How do i prevent the Cancel button from showing up. I don't want him to cancel... This is one of those rare circumstances where he has to enter a PO Number.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You can't control native dialog boxes in access. You will be better off using a custom form to capture your PO number.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jun 2005
    Posts
    102
    Quote Originally Posted by Teddy
    You can't control native dialog boxes in access. You will be better off using a custom form to capture your PO number.
    Teddy, thanx for your reply.. However, I do not have an idea on where to begin executing your advice. That insert statement I posted, what that does is once the PO is entered it grabs all records associated with that PO and adds them to the order. How can I capture all those records using a form? How do I use filters in a form?

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You can reference textboxes on a form with the syntax:

    forms!yourForm!yourControl

    You can prevent the user from executing the query by forcing them to provide a PO number before the query ever runs. For example:

    Private Sub yourButton_OnClick

    If nz(yourTextBox, "") = "" Then
    msgbox "Please provide a PO"
    exit sub
    Else
    'code to execute query goes here
    end if

    end sub
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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