Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I really need an answer to this question since it is holding up the whole process for me. I am using the form that was offered to me in post #5. I put in the choices in the drop box as explained by
    that post. It says that the record source does not exist. I am not sure where to take this. In other words how do I fix this?



    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  2. #17
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Still Can't Find Error in VBA code

    This is the row of code in question.

    Code:
    Me!cboAssoc_Gov.RowSource = "NADP;Pathways;Pathways 640"
    I changed it by dropping the pair of double quotes on the rhs. It still gave me an error. I also changed in the previous line
    "Gov" to "gov" , but again got nothing. This one has me confused in that I cannot see what I am doing wrong.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Last edited by Lou_Reed; 12-16-2016 at 03:17 PM. Reason: Correction

  3. #18
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    double post removed

  4. #19
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Did you make sure to change the Row Source Type property of Combo2 to Value List? That is the most likely source of the error.

  5. #20
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Yes, that did it. Just change Row Source Type for Combo2 to 'Value List".

    I have another problem here. If I start entering government workers and their associations, say I do it for 5 government workers. Then, when I enter a six worker who is not a government, but a contractor, I still get the choices for a government worker. This should not happen. There should be no choices for contr workers . Those choices are a holdover from putting in the government workers and they should be gone. Simply changing to a new worker who is a contr worker should offer no choices at all.

    I am guessing that the way to correct this is to use a requery statement. But where?

    I guess that I should put it immediately at the end of the government choices in the If-Endif section.

    It would be something like this.

    Old code

    Code:
    Private Sub cboGov_or_Contr_AfterUpdate()
       If Me!cboGov_or_Contr = "gov" Then
       Me!cboAssoc_Gov.RowSource = "NADP;Pathways;Pathways 640"
       End If
       Me!cboAssoc_Gov.Requery
    New code

    Code:
    Private Sub cboGov_or_Contr_AfterUpdate()
       If Me!cboGov_or_Contr = "gov" Then
       Me!cboAssoc_Gov.RowSource = "NADP;Pathways;Pathways 640"
       Me!cboAssoc_Gov.Requery
       End If
    Is this correct? Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  6. #21
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Not quite. The AfterUpdate procedure changes the list when you select "gov", but it doesn't do anything if you select something else, so this list in combo2 just stays there. What you need to do is clear the list if the other option is selected from combo1:

    Code:
    Private Sub cboGov_or_Contr_AfterUpdate()
       If Me!cboGov_or_Contr = "gov" Then
         Me!cboAssoc_Gov.RowSource = "NADP;Pathways;Pathways 640"
       else
         Me!cboAssoc_Gov.RowSource = ""   
       End If
       Me!cboAssoc_Gov.Requery

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cascading combo boxes
    By SunTop in forum Forms
    Replies: 2
    Last Post: 12-10-2016, 11:29 AM
  2. Cascading combo boxes... help me again please!
    By aqueousdan in forum Access
    Replies: 6
    Last Post: 09-20-2016, 06:54 AM
  3. Cascading Combo Boxes
    By Heathey94 in forum Queries
    Replies: 26
    Last Post: 09-05-2016, 03:02 PM
  4. Cascading combo boxes
    By combine21 in forum Forms
    Replies: 3
    Last Post: 12-02-2010, 12:57 PM
  5. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 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