Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    melhado
    Guest

    Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    This is really a 2-in-1 question, but they are related closely enough to make it one post. In searching the messages, I found nothing that resembles this problem. The more I try to resolve it, the more confused I am getting -- everything I read, this should work, but it doesn't. I have already tried the /decompile routine, but to no avail.

    Have a form with a combobox that shows valid part numbers, based on a query that shows the number in the first column and spelled out description in the other. The company is trying to get everyone used to working with the number, so I want to have a text box which will populate with the the description to ease the transition -- the position of this unbound text box may not necessarily be after, and will be made to look like a label, matching background color and all.

    The control is writing the proper column to the table, however, when I tried doing an after update event on the combobox control setting the value of column(1) -- which is the description -- to the unbound text control (txtDesc):

    <pre> Me![txtDesc]=cboPTnum.Column(1) </pre>


    got the ?Name error...tried setting the ControlSource property of [txtDesc] to "=Me![cboPTnum].Column(1)" and Access put brackets around each part, i.e., "=[Me!].[cboPTnum].[Column](1)" .. OI tried dropping the "Me!" and so forth, nothing worked, same error.

    After playing with this, I am not sure the after update will work, as I need the description to also show when the form is called up after data has been entered .. that is why I tried the ControlSource property idea.

    Then I tried to set the combobox (cboPTnum) to dropdown when the user entered it, so I wrote one line on the Enter event -- "cboPTnum.Dropdown" and then got an error message -- I can't seem to get the jpg screen capture to appear, so here it is paraphrased:

    <font color=red>The expression OnEnter you entered...produced the following error: A problem occurred while PROBE was communicating with the OLE server or Active X control

    *The expression may not result in the name of a macro...user defined function or [Event Procedure].
    *There may have been an error eveluating the fuction, event or macro.</font color=red>

    I get this error no matter what event I place the code in, the same with trying to populat txtDesc with the AftrerUpdate -- same error. I have no macros -- or for that matter, any other code on this, it is a new one with just tables so far. I have checked my syntax with other posts, help files, etc, and see no errors.

    Any ideas on what might be happening ..

    Thanks,

    'dave

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    use the onclick of the combo box

  3. #3
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    I wanted to make the data entry mouse-free, so the on click won't work. I did however, try it, and got the same error message! I don't think the event I place the dropdown code is going to make a difference, but thank you for your idea.

    Is it me or is the database corrupt beyond what decompile can fix?

    'dave

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Try
    <hr>Me![txtDesc]=[cboPTnum].Column(1)<hr>
    If that doesn't work, then you have a problem. The square brackets tell Access this is an object, and it stops trying to figure out what variable you want. Of course, I assume that the name of the combobox is spelled correctly and that you have two columns in it with the value you want to display in the second column.

    Your best bet might be the control source "=[cboPTNum].Column(1)". You can only use the Me keyword in a class module, including the module behind a form, so it gets dropped from controlsource if you try to add it. Then in the afterupdate event of the combobox, just requery the textbox, which will make it update itself.
    Charlotte

  5. #5
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Exactly what I have -- except the requery part, but still the same error message.

    OnEnter is where I want it to dropdown automatically, but it gives me the error for the OnEnter event, then I click OK, and it drops down, but upon leaving it, the same error comes up again, but for the AfterUpdate event!!! No matter what event I do it on, that error comes up.

    I have used the ControlSource property in txtDesc the same way you have it, yet I only get "?Name" .. Access was bracketing the column, but it suddenly stopped, but still doesn't work.

    Any idea what the problem might be? When I do the /decompile thing, the database just opens and there is no progress bar -- did it decompile it that quick? I compacted after and the problem still remained.

    Is it time to import all the objects (1 form and 5 tables -- 4 lookup tables, one bound to the form) into a new database, or is there another step I can try before doing that?

    Thanks for your feedback,

    'dave

    BTW, how does one actually post a screen capture? I have seen it done, is it as an attachment? All that does is keep asking me to paste the upload again into the box ... thanks again.

  6. #6
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    The trick is not to "Preview" after you've inserted your attachment. If you do, it disappears.

  7. #7
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Ohhhh .. So I have to have blind faith in technology, huh .... hmmmm

    thanks,
    'dave

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Well, the dropdown method needs to be in the GotFocus event rather than OnEnter. At least, I've never had any problems with it there.

    As for the second question, what exactly is PROBE? When I've received that message, one of several things might be going on: 1) I had called the OLE Server (whatever application I was trying to automate) incorrectly or by the wrong name, 2) I had a corrupt form, query, report, etc., 3) I had an ActiveX control (which is also an OLE Server) that I was abusing somehow., or 4) I had a query a layer or so down that had an error in it.

    Yes, it probably did decompile that quickly. You don't seem to see the same thing you did in Access 97 when you run decompile.

    Did you go into the VBE and compile the code before you compacted? If so, did any errors turn up? If not, then you may have a corrupted form or query--yes, queries can get corrupted too. One trick is to write the form's module to a text file and then save the form with the HasModules property set to No. Then see if the form loads and you get any errors. If everything works without the module, try opening the form's new module and pasting the text into it, then saving the form. That can clean out code corruption or at least point to where the problem is coming from.
    Charlotte

  9. #9
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Morning, hope your Fourth was restful.

    I initially did it on the GotFocus event, but got the same error; in looking for solutions, I came across the suggestion to do it on Enter..it happens on any event, as a matter of fact, no code for this form works.

    PROBE is the name they have hung on this database. This form in particular is a simple data entry form that writes to a single table, which I want to be as mouse free as possible, thus the desire to have automatic dropdown. The only query is the one used for the dropdown and the attempt to write .Column(1) to the unbound text box. The table it is based on is a lookup table which contains the part number and its description, along with some specs -- pretty straightforward.

    The form loads fine, just when I enter the dropdown do I get the problem, and the ?Name error in the unbound text box. Take out the event and it all works just fine, just not the way I wanted it to.

    I guess decompile doesn't repair forms <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15> At least this one is just at the start, with only tables and this form so far..so, to rebuild the form is not so big a deal....just wonder what it was I did that caused it. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23> One thing I did do was change the name of the file, when it was renamed, but I also changed the name in the VBE to match it, and the Application Title in Startup does not necessarily match it....could there be something I did wrong there?

    I will try your suggestions before I toss it out. At least now I know what to look for, and thankful that I don't have to import all the objects to another database.

    Thank you for your input

    'dave

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    If it works fine without a single event procedure, then it doesn't really sound like form corruption. Nevertheless, I'd try bulding a new form and see if you can duplicate the behavior. Oh, and Alt+down arrow will cause the combo to drop down from the keyboard. If all else fails, teach them the hot key.
    Charlotte

  11. #11
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    I am doing the new form, and new query for the dropdown. Deep down, I really don't want to duplicate the behavior, as curious as I may be.

    As for Alt+Down, still trying to teach them Shift and turning off CapLocks <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>... also need to get the unbound text box to show the description column, so I must assume (I know the dangers) that the form went on vacation for the fourth and isn't returning <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    Thank you again,

    'dave

  12. #12
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Update FYI...as I was building the new form, I had noticed as I was doing the query, that the SQL only had SELECT and not SELECT DISTINCT, as I had expected..might this have been the problem? In previous versions of Access, setting the query builder wrote it as DISTINCT.

    Anyway, I added the DISTINCT, and all is working as planned. Thanks for directing me to the solution.

    'dave

  13. #13
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    The DISTINCT keyword is not added as a default in Access 2000. It returns all records by default.
    Charlotte

  14. #14
    melhado
    Guest

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    Good to know. Why wasn't that listed in the What's New blurb? <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    Do you think it could have been my problem? In retrospect, I should have checked the code. Is there a logic to not including it, if it is needed to make it work?

    'dave

  15. #15
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Gone Awry (Access 2000 SR-1; NT 4 SP6)

    It's in there somewhere because I know I've seen it mentioned. I think it has to do with changes to the SQL to bring it closer to ANSI standard, but don't quote me on that.

    You need DISTINCTROW more often that DISTINCT in Access 2000 to make a query work or to make it updateable, but I don't know whether that was part of your problem or not.
    Charlotte

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •