Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    139

    Unanswered: Query field populated by another field

    Currently, I have a form that has this code in the "on load" event.

    ' Dim RCNumber As Long
    ' RCNumber = Recordset.Fields("RC#")
    ' If Not IsNull(Recordset.Fields("FFF")) Then
    ' RecordSource = "SELECT [RA ORDER DETAILS].[RC#], [RA ORDER DETAILS].RECDT, [RA ORDER DETAILS].SERIALREC, [RA ORDER DETAILS].FFF AS PRODID, PRODUCTS.PRODESC, PRODUCTS.PRODCAT, [RA ORDER DETAILS].QTY, [RA ORDER DETAILS].PROB, [RA ORDER DETAILS].REPCLOSDT, [RA ORDER DETAILS].REPLOCID, [RA ORDER DETAILS].ORIGSERIAL FROM PRODUCTS INNER JOIN ([RA ORDERS] INNER JOIN [RA ORDER DETAILS] ON [RA ORDERS].[ORDER#] = [RA ORDER DETAILS].[ORDER#]) ON PRODUCTS.PRODID = [RA ORDER DETAILS].FFF WHERE ((([RA ORDER DETAILS].[RC#])=" & RCNumber & "));"
    ' End If
    If Not IsNull(Recordset.Fields("FFF")) Then
    PRODID.ControlSource = "FFF"
    PRODESC.ControlSource = "FFFDESC"
    PRODCAT.ControlSource = "FFFCAT"
    End If

    What this does is if anything is in the FFF field, it will show in the prodid field on this form. The problem is that I need to do queries based on this same information. How can I set up a query to show me the same information. That is, if the FFF field is not null, place the FFF value in the Prodid field.

    Any suggestions would be appreciated.

    Thanks,
    B&R

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What goes in those fields if it is null?
    oh yeah... documentation... I have heard of that.

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

  3. #3
    Join Date
    Feb 2004
    Posts
    139
    The prodid field will stay as it is if the FFF field is null. The prodid always has a part number in it. It only needs to be replaced if the FFF field has something in it. The FFF field would then become the prodid field in the query.

    I hope this helps!

    Thanks,
    B&R

Posting Permissions

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