Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't enter data into combo on new record (2000)

    I have a combo box on a form that gives a 'To make changes to this field, first save this record' message when I try to make a selection from it on a new record. The combo box is bound to a field that does a 'lookup' in the form's underlying query, so that customer addresses appear on the form when the customer is selected. It is not part of the primary key of the main table in the query. I can enter a customer code directly into this field using the query, and it works fine, looking up addresss data as expected. I can also enter data into other fields on the form when creating a new record and the data is accepted. The combo box works fine when editing an existing record.

    Confused.

    Ian

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't enter data into combo on new record (2000)

    Ian,

    Does your combo box have the have the customer code as part of the row and is it set as the bound value?
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't enter data into combo on new record (2000)

    I have converted the combo box to a text box and still get the same problem. I have also simplified the underlying query (previously the customer code was used in three 'lookups', now only in one) and I still get the problem. But the problem only presents itself when trying to add records. Everything works as I would expect it when I am editing existing records. Could there be a form setting somewhere?

    The SQL of the form's recordsource is below. In apar_id means customer code in this database.

    SELECT tbl_NewSalesOrderHeader.*, tbl_Customers.apar_name, tbl_CustomerAddresses.address, tbl_CustomerAddresses.place, tbl_CustomerAddresses.province, tbl_CustomerAddresses.zip_code, tbl_Customers.address_id AS MainAddressID
    FROM (tbl_NewSalesOrderHeader LEFT JOIN tbl_Customers ON tbl_NewSalesOrderHeader.CustID = tbl_Customers.apar_id) LEFT JOIN tbl_CustomerAddresses ON (tbl_Customers.address_id = tbl_CustomerAddresses.address_id) AND (tbl_Customers.apar_id = tbl_CustomerAddresses.CustCode);

    Ian

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't enter data into combo on new record (2000)

    Ian,

    Check what is being sent from your combo box. Is it the customer code or is it the customer address. You say that when you enter the code it is accepted on a new record but if you select an address it is not until the record is added. That is because the look-up won't happen until the record is added. Your combo box should have the customer code being sent back to the table.

    Add customer code to your combo box and make it the bound field. In the properties, make the column count one greater, the column widths for the customer code should be zero, the Bound Column contains the position of the column that the customer code is in.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  5. #5
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't enter data into combo on new record (2000)

    Hi Don,

    The customer code is the bound field of the combo box. Also, I get the same problem if I convert the combo box to a text box, also bound to the cust ID. I therefore think that the combo box issue is a red herring, it's more likely to be a problem with the forms underlying query (see previous post) or with a property setting on the form. The thing that really confuses me is that it works perfectly when editing existing records. I can overwrite the customer code (or select a new customer from the combo) and the edit is accepted and new customer details appear cutesy of Access' autolookup feature. It just doesn't work when adding a new record.

    Thanks for your help

    Ian

Posting Permissions

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