Results 1 to 3 of 3
  1. #1
    fritesmodern is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    13

    Control based upon another control

    I have a textbox (txtbox) in access whose content is based upon a combobox (cmbbox) on another form (myform). cmbbox is bound to a lookup table. cmbbox displays text. I also have a function called getContent whose code is as follows:



    public function getcontent() as string
    getcontent = Forms!myform!cmbbox.Column(1, Forms!myform!cmbbox.ListIndex)
    end function


    If I set the "Control Source" property in txtbox to "=Forms!myform!cmbbox.Column(1, Forms!myform!cmbbox.ListIndex)", Access 2013 will automatically change it to "=[Forms]![myform]![cmbbox].[Column](1,[Forms]![myform]![cmbbox].
    [ListIndex])" and display a strange number instead of the text shown in cmbbox.

    However, if I set the "Control Source" property in txtbox to "=getContent()", txtbox will display the text in shown in cmbbox.


    Am I missing something here? The information retrieved by getcontent and txtbox is exactly the same. Thanks in advance.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Do you need the 2nd argument, what if you just did =Forms!myform!cmbbox.Column(1)

  3. #3
    fritesmodern is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    13
    Quote Originally Posted by Bulzie View Post
    Do you need the 2nd argument, what if you just did =Forms!myform!cmbbox.Column(1)
    Thanks! it works now!

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

Similar Threads

  1. Replies: 15
    Last Post: 05-12-2016, 02:27 PM
  2. Replies: 4
    Last Post: 02-18-2016, 12:06 PM
  3. Replies: 1
    Last Post: 10-06-2015, 06:50 AM
  4. Replies: 8
    Last Post: 06-19-2015, 02:19 AM
  5. Replies: 3
    Last Post: 03-29-2012, 12:40 PM

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