Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Angry Unanswered: Bizarre Combo Box query results (results from different record)

    I have a wierd problem where the lookup query for a combo box pulls data from a different record. Specifically, looking at the query below, the ctCompanyUID restriction makes it look like the ctCompanyUID from the first record in the database. If I edit the properties, and even return them to this same query, it will work - Until the form is closed and reopened.

    SELECT tblLocationMaster.LocationUID, [Address1] & ", " & [address2] & ", " & [city] & ", " & [state] & ", " & [zipcode] AS Expr1 FROM tblLocationMaster WHERE (((tblLocationMaster.CompanyUID)=[ctCompanyUID]));

    The form in question resides on one of four tab controls, each of which have parent/child relationships with the top level form. The top level form is "Customer", and the tabs/subforms are:
    Contact, Location, Contract, Equipment.
    Contract and equipment both use the same query (actually for contract, it has another subform that uses it) in combo boxes, and they all work - except the one on the contact form.

    I have repaired the database, deleted the subform and reloaded it, and tried explicitly changing ctCompanyUID to parent!companyuid with several form events, and even on the onfocus event for the combo box - all to no avail.

    Does anyone have an idea how to correct this behaviour?
    Last edited by jdostie; 08-30-06 at 15:57. Reason: correct spelling

  2. #2
    Join Date
    Oct 2003

    Solved, I think

    I send the db to a freind, and he looked at it and suggested I requery on gotfocus event for the combo box using:


    That seems to work. Although it is something of a mystery to me why I don't have to do that on the other forms - I may go ahead and put that code in where-ever I use a combo box in this fashion.

Posting Permissions

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