Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    1

    Unanswered: Auto populate function problem

    I have a stock file which is a linked table from my Sage software.
    On my form the stock code is selected from a drop down and then the description is auto filled into a text box, but when some stock codes are selected the text box remains blank.

    I am using =[Stock].[Column](1) as the control source for the text box.

    Any ideas why this only happens to some of the codes?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Are you sure a value in .column(1) actually exists for the value selected in the combobox?

    I might try using the =me.stock.column(1) versus =[stock].[column](1)

    You can also try actually requerying the text box.
    me.myTextBox.requery

    I might also try adding in a msgbox
    ie.
    msgbox me!Stock
    or
    msgbox me.stock.column(1)

    in the Afterupdate event of the stock combobox.

    or again, for your text box controlsource, instead of =[stock].[column](1), put this in instead:
    =me.stock.column(1)

    Another option is to actually put the formula in the Afterupdate event of your combobox:
    ie.
    Private Sub Stock_AfterUpdate()
    Refresh
    msgbox "The combobox value for column 1 is: " & me.stock.column(1)
    me!MyTextBoxName = me.stock.column(1) '<= note though: the controlsource for the textbox will need to be blank if doing this.
    end sub

    or

    Private Sub Stock_AfterUpdate()
    Refresh
    or
    me.MyTextBoxName.requery
    end sub
    Last edited by pkstormy; 11-28-09 at 17:38.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If a value actually exists for the stock combobox (ie. column(1)) and none of the above works, I've often seen where the network itself was the cause of the problem. For example, a daisy-chained network with a slow connection would sometimes cause 'hiccups' in listbox/combobox displays and not return all the values when it should. I doubt this is the problem but it's something to throw out there if none of the above works.

    This is something you may want to research if you see other problems with comboboxes/listboxes. When I was working with a set of daisy-chain-hubs for the network (or the network cards themselves were older, slow cards), I would often get 'partial' returns and it wouldn't show all the records it was supposed to.

    The only other thing I can think of offhand is that the driver itself for your connection to the Sage software is not always working as it should. If you've noticed this to be a persistent type of problem, maybe updating the driver itself may help. I once used a Progressive driver to connect to a unix type backend db and it sometimes tended to be a little flaky. After updating with the latest driver, this seemed to resolve the problem.

    Also try to diagnose if this is a specific problem only to 1 computer or if it happens for every computer user. If it's only limited to 1 computer, check to see if perhaps some other software (ie anti-virus) is perhaps interferring with the connection. There are several possibilities here for your problem and hopefully through troubleshooting, you can narrow down if it's a specific computer or user or if it happens to everyone.
    Last edited by pkstormy; 11-28-09 at 17:51.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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