Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    104

    Unanswered: If statement Help

    I have a form that fills out a table. In this for there are fields like part description, part number, etc. All of the fields i'm working with in my form are combo boxes. I building a library of gages that our company owns that it lends out to employees to do a job. The two fields i'm working with is Item location and item status. Item location is where the gage is currently located (ie. the department that borrowed the item). The status field tells me whether the item is in stock or has been borrowed. What i want to do is when someone returns an item and selects to change the item status to "Checked In" it automatically changes the field "department" to "QC Lab" or which is where we store all the gages. I have tried many things including if statements like this:
    IIf([Gagelist].[GageStatus]="Checked In","Qc Lab")

    and this

    IIf([GageList]![GageStatus]="CheckednIn",[GageTransactionList]![Machine]="Qc Lab")

    I tried putting this in a query and in a button control but still get no good result. I still very new at this so i'm sure it can be done but i don't know the best place to do this much less the correct statement. Any help you can give will be greatly appreciated.

  2. #2
    Join Date
    May 2009
    Posts
    258
    The IIf function has a condition, true part, and false part. The statements you listed are both missing the false part, but the first one is the closest to being valid. Following would probably be better:
    Code:
    IIf([Gagelist].[GageStatus]="Checked In","Qc Lab",[GageTransactionList]![Machine])
    This will return either "Qc Lab" or the current [GageTransactionList]![Machine] value.

    Regards,

    Ax

  3. #3
    Join Date
    May 2009
    Posts
    104
    What i tried to do is edit the macro for the button, "Save and New" to complete this task before it saves the record and goes to a new one but i get an error "This object doesnt contain automation object 'GageList.' Is this possible or should i do this in a different location, query etc.

  4. #4
    Join Date
    May 2009
    Posts
    258
    Where are you using the IIf function? Please post code/query, if applicable.

Posting Permissions

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