Results 1 to 4 of 4
  1. #1
    Beanochini is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    3

    Combo Box Issues

    I am in process of building my 1st Database and do not have much experience. The database is for credit card expenses and has credit card name, date, amount, currency and calculated field for GBP equivalent. I have also put in two Combo boxes. one For Main expense Category and another for a Sub Category. There are three Tables (Category, Subcategory and main expenses table). The form picks up from the main expenses table and the combo boxes are populated from Category and Sub Category tables. A query is used as the Row source for the Subcategory to filter for these depending on the Category. I have also put in an event :



    Private Sub CboCategoryP_AfterUpdate()
    Me.CboSubCatP.Requery
    Me.CboSubCatP.Value = ""


    End Sub

    The form writes the Value for category and Subcategory in the main Expenses table.

    It all seemed to work but although the value is written to the main table it is not displayed in the form (except when I input using the selection dropdown for the category and subcategory) If I move to the next record and then come back, the category and subcategory are either blank or have different values in them

    As a novice I am must be doing something wrong- any help would be appreciated. Driving me bonkers - and so far spent 3 days trying to sort it! Access 2016, Window 10 64

    Cheers
    Beanochini
    Last edited by Beanochini; 02-02-2019 at 09:55 AM. Reason: Adding Access version

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    Me.CboSubCatP= null
    Me.CboSubCatP.Requery

    PROVIDING the CboSubCatP query looks at combo1:

    select SubCat from tCatagory where [cat] = forms!myform!CboCategoryP


  3. #3
    Beanochini is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    3
    Thanks. Not sure I understand the last bit

    The three tables are MainExpensesT (this has the Combobox], CategoryPT (has list of Primaery Categories and of course the autonumber as the key) and the MainSubCatT (has Sub Categories list, Autonumber key, CategoryP as a long integer number (foreign key)) the query is run on the MainSubCatT, and the criteria is [Forms]![MainExpF]![CboCategoryP] (this is titled MainSubCatQ) and becomes the Row source. Is there a problem with this? Thanks in anticipation!

  4. #4
    Beanochini is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    3
    The above worked well when I tried it out as a stand-alone test. It delivered the appropriate Sub Categories to the second combo box. It does so now too... and the Main expenses form (MainExpF) stores the correct value in the MainExpensesT but as soon as I move to the next record the form losses the original values but the Table retains the correct value.
    Cheers

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

Similar Threads

  1. Combo box issues
    By Lou_Reed in forum Access
    Replies: 40
    Last Post: 05-02-2017, 04:37 PM
  2. Replies: 3
    Last Post: 01-29-2016, 08:52 PM
  3. Issues with combo boxes
    By Accu-Grind in forum Forms
    Replies: 8
    Last Post: 05-14-2015, 05:24 PM
  4. Combo Box Issues on Form
    By aceoftrades in forum Forms
    Replies: 4
    Last Post: 12-28-2013, 12:47 PM
  5. 3rd Combo Box Cascade Issues
    By GAccess in forum Forms
    Replies: 12
    Last Post: 03-06-2012, 03:16 PM

Tags for this Thread

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