Results 1 to 4 of 4
  1. #1
    akhmadahdiyat is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2013
    Posts
    21

    ControlSource problem

    why I can't set control source for control ?

    Code:
        varUserID = "=IIf(IsError([UserCariSubForm].[Form]![Login]);'';[UserCariSubForm].[Form]![Login])"
        Msgbox varUserID              'the message result exactly the same in expression box.
        TextUserID.ControlSource = varUserID


  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    does this works ?
    Code:
     varUserID = "=IIf(IsError([UserCariSubForm].[Form]![Login]),' ',[UserCariSubForm].[Form]![Login])"
        Msgbox varUserID              'the message result exactly the same in expression box.
        TextUserID.ControlSource = varUserID

  3. #3
    akhmadahdiyat is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2013
    Posts
    21
    replace ; with ,
    it works,, thanks.. i wonder why..

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    It is the syntax for IIF statement

    IIF(Condition,If true this,If false this)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 17
    Last Post: 06-19-2013, 02:58 PM
  2. DLookup as ControlSource for a text box?
    By GraeagleBill in forum Forms
    Replies: 4
    Last Post: 03-29-2013, 05:09 PM
  3. Textbox ControlSource Question
    By RonL in forum Forms
    Replies: 4
    Last Post: 02-16-2013, 12:18 AM
  4. Replies: 2
    Last Post: 10-27-2011, 10:28 AM
  5. Subform ControlSource Popup issue
    By GraemeG in forum Forms
    Replies: 10
    Last Post: 04-07-2011, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums