Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Combo Box Enable Question!

Discussion in 'Information Technology' started by Bob, Jul 28, 2006.

  1. Bob

    Bob
    Expand Collapse
    Guest

    I have a form that has a combo Box that has 2 options in Row source (Active
    &
    Finished)cbStatus, and another combo box that list clients, is possible to
    lock The clients Combo Box cbOwnerID when it is in active mode (Enable No)
    when in finished mode (Enable Yes)

    Thanks in advance.........Bob Vance
     
  2. Loading...


  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Bob,

    of course...

    in the code behind your form, create this:

    '~~~~~~~~~~~~
    Private Function LockClient()
    dim mBoo as boolean
    if nz(cbStatus, "Active") = "Active" then
    mBoo = true
    else
    mBoo = false
    endif
    me.cbOwnerID.enabled = mBoo
    End Function
    '~~~~~~~~~~~~

    on the AfterUpdate event of cbStatus -->
    =LockClient()

    on the form OnCurrent event -->
    =LockClient()

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Bob wrote:
    > I have a form that has a combo Box that has 2 options in Row source (Active
    > &
    > Finished)cbStatus, and another combo box that list clients, is possible to
    > lock The clients Combo Box cbOwnerID when it is in active mode (Enable No)
    > when in finished mode (Enable Yes)
    >
    > Thanks in advance.........Bob Vance
    >
    >
     
  4. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Or, even simpler,

    Private Function LockClient()
    Me.cbOwnerID.Enabled = (Nz(cbStatus, "Active") = "Active")
    End Function


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    > Hi Bob,
    >
    > of course...
    >
    > in the code behind your form, create this:
    >
    > '~~~~~~~~~~~~
    > Private Function LockClient()
    > dim mBoo as boolean
    > if nz(cbStatus, "Active") = "Active" then
    > mBoo = true
    > else
    > mBoo = false
    > endif
    > me.cbOwnerID.enabled = mBoo
    > End Function
    > '~~~~~~~~~~~~
    >
    > on the AfterUpdate event of cbStatus -->
    > =LockClient()
    >
    > on the form OnCurrent event -->
    > =LockClient()
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > Bob wrote:
    > > I have a form that has a combo Box that has 2 options in Row source

    (Active
    > > &
    > > Finished)cbStatus, and another combo box that list clients, is possible

    to
    > > lock The clients Combo Box cbOwnerID when it is in active mode (Enable

    No)
    > > when in finished mode (Enable Yes)
    > >
    > > Thanks in advance.........Bob Vance
    > >
    > >
     
  5. Bob

    Bob
    Expand Collapse
    Guest

    Do I put these codes behind cbOwnerID or On the Form, And where abouts do I
    puy them once im there? Thanks For your Help...Bob

    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:eg93OXiiGHA.1936@TK2MSFTNGP04.phx.gbl...
    > Or, even simpler,
    >
    > Private Function LockClient()
    > Me.cbOwnerID.Enabled = (Nz(cbStatus, "Active") = "Active")
    > End Function
    >
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    > news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >> Hi Bob,
    >>
    >> of course...
    >>
    >> in the code behind your form, create this:
    >>
    >> '~~~~~~~~~~~~
    >> Private Function LockClient()
    >> dim mBoo as boolean
    >> if nz(cbStatus, "Active") = "Active" then
    >> mBoo = true
    >> else
    >> mBoo = false
    >> endif
    >> me.cbOwnerID.enabled = mBoo
    >> End Function
    >> '~~~~~~~~~~~~
    >>
    >> on the AfterUpdate event of cbStatus -->
    >> =LockClient()
    >>
    >> on the form OnCurrent event -->
    >> =LockClient()
    >>
    >> Warm Regards,
    >> Crystal
    >> Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >> Bob wrote:
    >> > I have a form that has a combo Box that has 2 options in Row source

    > (Active
    >> > &
    >> > Finished)cbStatus, and another combo box that list clients, is possible

    > to
    >> > lock The clients Combo Box cbOwnerID when it is in active mode (Enable

    > No)
    >> > when in finished mode (Enable Yes)
    >> >
    >> > Thanks in advance.........Bob Vance
    >> >
    >> >

    >
    >
     
  6. Bob

    Bob
    Expand Collapse
    Guest

    Crystal cant find this:
    on the form OnCurrent event -->
    =LockClient()

    Thanx ..Bob

    "Bob" <xxx@xx.xx> wrote in message news:e67sdo$54s$1@lust.ihug.co.nz...
    > Do I put these codes behind cbOwnerID or On the Form, And where abouts do
    > I puy them once im there? Thanks For your Help...Bob
    >
    > "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:eg93OXiiGHA.1936@TK2MSFTNGP04.phx.gbl...
    >> Or, even simpler,
    >>
    >> Private Function LockClient()
    >> Me.cbOwnerID.Enabled = (Nz(cbStatus, "Active") = "Active")
    >> End Function
    >>
    >>
    >> --
    >> Doug Steele, Microsoft Access MVP
    >> http://I.Am/DougSteele
    >> (no e-mails, please!)
    >>
    >>
    >> "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    >> news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >>> Hi Bob,
    >>>
    >>> of course...
    >>>
    >>> in the code behind your form, create this:
    >>>
    >>> '~~~~~~~~~~~~
    >>> Private Function LockClient()
    >>> dim mBoo as boolean
    >>> if nz(cbStatus, "Active") = "Active" then
    >>> mBoo = true
    >>> else
    >>> mBoo = false
    >>> endif
    >>> me.cbOwnerID.enabled = mBoo
    >>> End Function
    >>> '~~~~~~~~~~~~
    >>>
    >>> on the AfterUpdate event of cbStatus -->
    >>> =LockClient()
    >>>
    >>> on the form OnCurrent event -->
    >>> =LockClient()
    >>>
    >>> Warm Regards,
    >>> Crystal
    >>> Microsoft Access MVP 2006
    >>>
    >>> *
    >>> Have an awesome day ;)
    >>>
    >>> remote programming and training
    >>> strive4peace2006 at yahoo.com
    >>>
    >>> *
    >>>
    >>> Bob wrote:
    >>> > I have a form that has a combo Box that has 2 options in Row source

    >> (Active
    >>> > &
    >>> > Finished)cbStatus, and another combo box that list clients, is
    >>> > possible

    >> to
    >>> > lock The clients Combo Box cbOwnerID when it is in active mode (Enable

    >> No)
    >>> > when in finished mode (Enable Yes)
    >>> >
    >>> > Thanks in advance.........Bob Vance
    >>> >
    >>> >

    >>
    >>

    >
    >
     
  7. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Bob,

    if you put the code behind the form, for some reason, the
    builder button (...) can't find it -- but it works! It must
    be a FUNCTION not a Sub

    on the other hand, if you refer to a general function, the
    builder button will take you there...

    To get to the code behind the form, choose View, Code from
    the menu while you are in the design view of your form

    The reason I did not have you do [Event Prcedure] is because
    you need the same code for more than one event

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Bob wrote:
    > Crystal cant find this:
    > on the form OnCurrent event -->
    > =LockClient()
    >
    > Thanx ..Bob
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e67sdo$54s$1@lust.ihug.co.nz...
    >
    >>Do I put these codes behind cbOwnerID or On the Form, And where abouts do
    >>I puy them once im there? Thanks For your Help...Bob
    >>
    >>"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >>news:eg93OXiiGHA.1936@TK2MSFTNGP04.phx.gbl...
    >>
    >>>Or, even simpler,
    >>>
    >>>Private Function LockClient()
    >>> Me.cbOwnerID.Enabled = (Nz(cbStatus, "Active") = "Active")
    >>>End Function
    >>>
    >>>
    >>>--
    >>>Doug Steele, Microsoft Access MVP
    >>>http://I.Am/DougSteele
    >>>(no e-mails, please!)
    >>>
    >>>
    >>>"strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    >>>news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >>>
    >>>>Hi Bob,
    >>>>
    >>>>of course...
    >>>>
    >>>>in the code behind your form, create this:
    >>>>
    >>>>'~~~~~~~~~~~~
    >>>>Private Function LockClient()
    >>>> dim mBoo as boolean
    >>>> if nz(cbStatus, "Active") = "Active" then
    >>>> mBoo = true
    >>>> else
    >>>> mBoo = false
    >>>> endif
    >>>> me.cbOwnerID.enabled = mBoo
    >>>>End Function
    >>>>'~~~~~~~~~~~~
    >>>>
    >>>>on the AfterUpdate event of cbStatus -->
    >>>>=LockClient()
    >>>>
    >>>>on the form OnCurrent event -->
    >>>>=LockClient()
    >>>>
    >>>>Warm Regards,
    >>>>Crystal
    >>>>Microsoft Access MVP 2006
    >>>>
    >>>> *
    >>>> Have an awesome day ;)
    >>>>
    >>>> remote programming and training
    >>>> strive4peace2006 at yahoo.com
    >>>>
    >>>> *
    >>>>
    >>>>Bob wrote:
    >>>>
    >>>>>I have a form that has a combo Box that has 2 options in Row source
    >>>
    >>>(Active
    >>>
    >>>>>&
    >>>>>Finished)cbStatus, and another combo box that list clients, is
    >>>>>possible
    >>>
    >>>to
    >>>
    >>>>>lock The clients Combo Box cbOwnerID when it is in active mode (Enable
    >>>
    >>>No)
    >>>
    >>>>>when in finished mode (Enable Yes)
    >>>>>
    >>>>>Thanks in advance.........Bob Vance
    >>>>>
    >>>>>
    >>>
    >>>

    >>

    >
    >
     
  8. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Bob,

    look at my next post

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Bob wrote:
    > Do I put these codes behind cbOwnerID or On the Form, And where abouts do I
    > puy them once im there? Thanks For your Help...Bob
    >
    > "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:eg93OXiiGHA.1936@TK2MSFTNGP04.phx.gbl...
    >
    >>Or, even simpler,
    >>
    >>Private Function LockClient()
    >> Me.cbOwnerID.Enabled = (Nz(cbStatus, "Active") = "Active")
    >>End Function
    >>
    >>
    >>--
    >>Doug Steele, Microsoft Access MVP
    >>http://I.Am/DougSteele
    >>(no e-mails, please!)
    >>
    >>
    >>"strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    >>news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >>
    >>>Hi Bob,
    >>>
    >>>of course...
    >>>
    >>>in the code behind your form, create this:
    >>>
    >>>'~~~~~~~~~~~~
    >>>Private Function LockClient()
    >>> dim mBoo as boolean
    >>> if nz(cbStatus, "Active") = "Active" then
    >>> mBoo = true
    >>> else
    >>> mBoo = false
    >>> endif
    >>> me.cbOwnerID.enabled = mBoo
    >>>End Function
    >>>'~~~~~~~~~~~~
    >>>
    >>>on the AfterUpdate event of cbStatus -->
    >>>=LockClient()
    >>>
    >>>on the form OnCurrent event -->
    >>>=LockClient()
    >>>
    >>>Warm Regards,
    >>>Crystal
    >>>Microsoft Access MVP 2006
    >>>
    >>> *
    >>> Have an awesome day ;)
    >>>
    >>> remote programming and training
    >>> strive4peace2006 at yahoo.com
    >>>
    >>> *
    >>>
    >>>Bob wrote:
    >>>
    >>>>I have a form that has a combo Box that has 2 options in Row source

    >>
    >>(Active
    >>
    >>>>&
    >>>>Finished)cbStatus, and another combo box that list clients, is possible

    >>
    >>to
    >>
    >>>>lock The clients Combo Box cbOwnerID when it is in active mode (Enable

    >>
    >>No)
    >>
    >>>>when in finished mode (Enable Yes)
    >>>>
    >>>>Thanks in advance.........Bob Vance
    >>>>
    >>>>

    >>
    >>

    >
    >
     
  9. Bob

    Bob
    Expand Collapse
    Guest

    Do I put this code at the very end of the other codes?
    And still cant find:
    on the form OnCurrent event -->
    =LockClient()

    Regards Bob

    "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    > Hi Bob,
    >
    > of course...
    >
    > in the code behind your form, create this:
    >
    > '~~~~~~~~~~~~
    > Private Function LockClient()
    > dim mBoo as boolean
    > if nz(cbStatus, "Active") = "Active" then
    > mBoo = true
    > else
    > mBoo = false
    > endif
    > me.cbOwnerID.enabled = mBoo
    > End Function
    > '~~~~~~~~~~~~
    >
    > on the AfterUpdate event of cbStatus -->
    > =LockClient()
    >
    > on the form OnCurrent event -->
    > =LockClient()
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > Bob wrote:
    >> I have a form that has a combo Box that has 2 options in Row source
    >> (Active &
    >> Finished)cbStatus, and another combo box that list clients, is possible
    >> to
    >> lock The clients Combo Box cbOwnerID when it is in active mode (Enable
    >> No)
    >> when in finished mode (Enable Yes)
    >>
    >> Thanks in advance.........Bob Vance
     
  10. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Bob,

    the LockClient code needs to be behind your form

    from the menu, when you are in the deign view of your form:

    View, Code

    You can also use the code that Doug gave you -- they both do
    the same thing. Doug's code is more efficient, but I was
    not sure how much you program, so mine is longer.

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Bob wrote:
    > Do I put this code at the very end of the other codes?
    > And still cant find:
    > on the form OnCurrent event -->
    > =LockClient()
    >
    > Regards Bob
    >
    > "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    > news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >
    >>Hi Bob,
    >>
    >>of course...
    >>
    >>in the code behind your form, create this:
    >>
    >>'~~~~~~~~~~~~
    >>Private Function LockClient()
    >> dim mBoo as boolean
    >> if nz(cbStatus, "Active") = "Active" then
    >> mBoo = true
    >> else
    >> mBoo = false
    >> endif
    >> me.cbOwnerID.enabled = mBoo
    >>End Function
    >>'~~~~~~~~~~~~
    >>
    >>on the AfterUpdate event of cbStatus -->
    >>=LockClient()
    >>
    >>on the form OnCurrent event -->
    >>=LockClient()
    >>
    >>Warm Regards,
    >>Crystal
    >>Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >>Bob wrote:
    >>
    >>>I have a form that has a combo Box that has 2 options in Row source
    >>>(Active &
    >>>Finished)cbStatus, and another combo box that list clients, is possible
    >>>to
    >>>lock The clients Combo Box cbOwnerID when it is in active mode (Enable
    >>>No)
    >>>when in finished mode (Enable Yes)
    >>>
    >>>Thanks in advance.........Bob Vance

    >
    >
    >
     
  11. Bob

    Bob
    Expand Collapse
    Guest

    Ok I put dougs code in code behind the form should I have to do anything
    else, because i cant seem to get it to work...Thanks Bob

    "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    news:eeIS$h2iGHA.3884@TK2MSFTNGP04.phx.gbl...
    > Hi Bob,
    >
    > the LockClient code needs to be behind your form
    >
    > from the menu, when you are in the deign view of your form:
    >
    > View, Code
    >
    > You can also use the code that Doug gave you -- they both do the same
    > thing. Doug's code is more efficient, but I was not sure how much you
    > program, so mine is longer.
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > Bob wrote:
    >> Do I put this code at the very end of the other codes?
    >> And still cant find:
    >> on the form OnCurrent event -->
    >> =LockClient()
    >>
    >> Regards Bob
    >>
    >> "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
    >> news:%23wY6deeiGHA.4140@TK2MSFTNGP03.phx.gbl...
    >>
    >>>Hi Bob,
    >>>
    >>>of course...
    >>>
    >>>in the code behind your form, create this:
    >>>
    >>>'~~~~~~~~~~~~
    >>>Private Function LockClient()
    >>> dim mBoo as boolean
    >>> if nz(cbStatus, "Active") = "Active" then
    >>> mBoo = true
    >>> else
    >>> mBoo = false
    >>> endif
    >>> me.cbOwnerID.enabled = mBoo
    >>>End Function
    >>>'~~~~~~~~~~~~
    >>>
    >>>on the AfterUpdate event of cbStatus -->
    >>>=LockClient()
    >>>
    >>>on the form OnCurrent event -->
    >>>=LockClient()
    >>>
    >>>Warm Regards,
    >>>Crystal
    >>>Microsoft Access MVP 2006
    >>>
    >>> *
    >>> Have an awesome day ;)
    >>>
    >>> remote programming and training
    >>> strive4peace2006 at yahoo.com
    >>>
    >>> *
    >>>
    >>>Bob wrote:
    >>>
    >>>>I have a form that has a combo Box that has 2 options in Row source
    >>>>(Active &
    >>>>Finished)cbStatus, and another combo box that list clients, is possible
    >>>>to
    >>>>lock The clients Combo Box cbOwnerID when it is in active mode (Enable
    >>>>No)
    >>>>when in finished mode (Enable Yes)
    >>>>
    >>>>Thanks in advance.........Bob Vance

    >>
    >>
     

Share This Page