Results 1 to 4 of 4
  1. #1
    opopanax666 is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    27

    VBA: combobox not defined?

    Hi everybody,



    made an unbound form with one combobox used to filter another. Everything worked great until I used "Option explicit" in the code. I get this error:



    What it says is that the AfterUpdate gives a Variable Not Defined error.

    Here's the AfterUpdate code:
    Code:
    Private Sub cboHoofd_AfterUpdate()
    
      Me.cboSub1 = Null
      Me.cboSub1.Requery
      Me.cboSub1 = Me.cboSub1.ItemData(0)
    
    End Sub
    Can someone please spot the error?

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Are you ABSOLUTELY sure that your combo is named cboSub1?

    Also, your database might need to run a DECOMPILE which can resync up the VBA which can sometimes get off (make sure to make a backup copy BEFORE doing the decompile).

  3. #3
    opopanax666 is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    27
    Quote Originally Posted by boblarson View Post
    Are you ABSOLUTELY sure that your combo is named cboSub1?
    Yes, as I said it all worked fine before the "Option Explicit".

    Quote Originally Posted by boblarson View Post
    Also, your database might need to run a DECOMPILE which can resync up the VBA which can sometimes get off (make sure to make a backup copy BEFORE doing the decompile).
    The problem is that I have access to Access () through a Citrix client, and I have no clue what the path to the Access.exe is to run the decompile commandline...

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by opopanax666 View Post
    The problem is that I have access to Access () through a Citrix client, and I have no clue what the path to the Access.exe is to run the decompile commandline...
    Can you not download the Access file to your desktop? We run Citrix and I am responsible for our Access databases and I can download it to my desktop. But I don't have to because I have access to the Citrix desktop. You may need to get some IT folk involved to let them know you need to be able to do this, even if it is just a one time shot. Someone needs to be able to do things with the file. Is this a split database? If not, it really needs to be and each user should be getting a copy of the frontend loaded to a temp directory that Citrix makes when they log in.

    Where I work we run a batch file which copies the frontend into a temp directory on the Citrix machine so that each user has their own copy otherwise it can cause major problems and corruption.

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Application-defined or object-defined error
    By hawkins in forum Access
    Replies: 6
    Last Post: 07-01-2011, 01:57 PM
  3. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  4. Error: "User-defined type not defined"
    By mastromb in forum Programming
    Replies: 10
    Last Post: 01-08-2010, 02:57 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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