Results 1 to 5 of 5
  1. #1
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42

    Problems posting a .value to a ComboBox

    I have a combobox:

    Name: NCRcbx
    Control Source: NCRcbx
    Column count: 2
    Bound Column: 1

    Row Source: #SELECT [NCRT].[NCRID], [NCRT].[NCRNumber] FROM NCRT ORDER BY [NCRNumber]; #
    Enabled: Yes
    Limit to List: Yes
    Inherit Value List: Yes
    Show Only Row Source Value: No
    Locked: No


    etc..

    NCRID would be like 486 and NCRNumber would be like "NCR23015".
    I can click on the combo box and find that same record but cannot write it manually.

    I tried
    Code:
    NCRcbx.Value = NCRID
    but it says I can't assign a value to that object.
    Help??

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You don't tell us what NCRID is you could try:
    Code:
    NCRcbx = NCRID
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42
    Quote Originally Posted by Bob Fitz View Post
    You don't tell us what NCRID is you could try:
    Code:
    NCRcbx = NCRID
    NCRID is a numerical value of 486
    NCRNumber is a string value.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,118
    You are not being very clear, I assume you are hiding the first column and just displaying the NCRNumber? If that's the case try using a dLookup:
    Code:
    Me.cboNCR=dLookup("NCRID","NCRT","NCRNumber='" & ME.NCRNumber & "'") 'adjust for your control names
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42
    Thanks for the tips guys..
    I figured it out. (Sorry I'm still kind of new to this..)
    My Table has two fields in it - NCRID and NCRNumber where NCRID was keyed.
    Values were like (example)
    NCRID NCRNumber
    485 RMA49123
    486 RMA49124
    etc..
    I had the Combobox Control Source as NCRID.. It was supposed to be unbound.
    Linking to the control source told Access if I typed anything in it wanted it stored in NCRID (I think?)
    Because NCRID is keyed, it would not allow duplicates and would not show it.
    Simply deleting the combobox Control Source allowed it to work.
    Please let me know if this seems correct... it's working anyway..

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

Similar Threads

  1. combobox select problems
    By JQuinnC in forum Access
    Replies: 2
    Last Post: 05-18-2016, 12:58 PM
  2. Posting Database for help
    By Diamond in forum Queries
    Replies: 1
    Last Post: 03-22-2013, 10:19 AM
  3. Combobox and Saving problems
    By manicamaniac in forum Access
    Replies: 1
    Last Post: 07-31-2010, 11:58 PM
  4. Posting forms on a website
    By nellb13 in forum Forms
    Replies: 0
    Last Post: 06-22-2010, 11:13 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