none
Error 4104: .... could not be bound RRS feed

  • Question

  • Hi all,

    I have a pass-through query where I receive the message "The multi-part identifier [FieldName] could not be bound". I have read several forums about this error, but still cannot resolve it:

    SELECT
    Parent_WorkOrder_wrkWorkOrders.Code as [ParentWorkOrderCode],
    Parent_WorkOrder_wrkWorkOrders.Description as [ParentWorkOrderDescription],
    Parent_reqRequisitions.Code as [ParentCode],
    Parent_reqRequisitions.Requester as [ParentRequester],
    Parent_RequisitionStatus_reqRequisitionStatuses.Description as [ParentRequisitionStatusDescription],
    reqRequisitionItemsUDFV_TableLink.SysproRequisitionNumber as [SysproRequisitionNumber],
    WorkTaskSpare_wrkTaskSpares.ItemCode as [WorkTaskSpareItemCode],
    WorkTaskSpare_wrkTaskSpares.ItemDescription as [WorkTaskSpareItemDescription],
    Parent_reqRequisitions.Id as [ParentId]
    FROM
    reqRequisitionItems reqRequisitionItems
    join reqRequisitions Parent_reqRequisitions on (Parent_reqRequisitions.Id = reqRequisitionItems.ParentId)
    join wrkWorkOrders Parent_WorkOrder_wrkWorkOrders on (Parent_WorkOrder_wrkWorkOrders.Id = Parent_reqRequisitions.WorkOrderId)
    join reqRequisitionStatuses Parent_RequisitionStatus_reqRequisitionStatuses on (Parent_RequisitionStatus_reqRequisitionStatuses.Id = Parent_reqRequisitions.RequisitionStatusId)
    left outer join reqRequisitionItemsUDFV reqRequisitionItemsUDFV_TableLink on (reqRequisitionItemsUDFV_TableLink.TableLinkId = reqRequisitionItems.Id)
    join wrkTaskSpares WorkTaskSpare_wrkTaskSpares on (WorkTaskSpare_wrkTaskSpares.Id = reqRequisitionItems.WorkTaskSpareId)
    WHERE
    ((Parent_RequisitionStatus_reqRequisitionStatuses.Code not in (N'CA')) OR (Parent_RequisitionStatus_reqRequisitionStatuses.Code is null)) AND reqRequisitionItems.Id >= 0
    AND Parent_WorkOrder_wrkWorkOrders.Code = Forms.FRM_RTS_OnKey.OnKeyWONumber

    If I change the last line to "...Parent_WorkOrder_wrkWorkOrders.Code = 'R15510' ", it runs fine and retrieves the data, but I do not know what the number will be as it will be completed by the user on the form "FRM_RTS_OnKey". The variable "OnKeyWONumber" is a text field on the form where the user will enter the number.

    As always, your assistance is appreciated.

    Thanks

    Deon

    Friday, May 19, 2017 6:14 AM

Answers

All replies

  • Hi Deon SA,

    try to refer to textbox like below.

    Forms!FRM_RTS_OnKey!OnKeyWONumber

    you can try to fetch value separately first and test it whether you can able to fetch it or not.

    if you able to fetch it then add that syntax to your query to solve the issue.

    Reference:

    Control Object (Access)

    Note: you need to declare the variable and then you need to store value in that and pass it in the query.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, May 19, 2017 7:32 AM
    Moderator
  • Thanks, but it does not solve the issue.

    If I put in an actual value for OnKeyWONumber, the query retrieves the correct data.

    If I change the query to "Forms!FRM_RTS_OnKey!OnKeyWONumber", then I receive the following error:

    "Incorrect Syntax near '!'. (#102)"

    Friday, May 19, 2017 7:49 AM
  • Hi Deon SA,

    how you added the Forms!FRM_RTS_OnKey!OnKeyWONumber?

    did you try to concatenate it with your query using '&' sign?

    please refer thread below may help you.

    Can a Pass Through Query read values from Forms? ([Form].[frmTest].[txtTest])?

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Deon SA Friday, May 19, 2017 9:19 AM
    Friday, May 19, 2017 8:22 AM
    Moderator
  • Thanks a mill!!

    Modifying the Pass-Through query on the fly did the trick.

    Thanks

    Friday, May 19, 2017 9:19 AM