+ Reply to Thread
Results 1 to 5 of 5

Combobox Selections Not Saving To Table

  1. #1
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Question Combobox Selections Not Saving To Table

    Heres my problem

    I have created two tables Table 1 Project Details and Table 2 Builders Details.

    I have created 2 forms using the wizard selecting all fields in each table for each form
    frmProjectDetails and frmBuildersDetails


    I have changed one textbox to a combo box to Table 1 Projects Form to look up Builders name address etc from Table 2 Builders Details and insert into Table 1 Project Details.

    Any data entered manually into the form saves to the table ok but the combo box selections do not save to the table.

    Can anyone shed some light on why this happening as I have spent hours searching for a sloution

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,924

    Re: Combobox Selections Not Saving To Table

    Is anything appearing in your table where you expect the builder name to appear. A number perhaps? Or is the field for the record blank? Have you double checked the properties for the control (combobox) and ensured that the Control Source in the properties indicates the field in your table correctly?

    In the properties for the combo box, on the data tab, what is the bound column? Lastly, can you provide the SQL statement for the row source from the data tab in the properties.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Combobox Selections Not Saving To Table

    Ok I have tried everything

    This is what I have

    tblProjectsDetails frmNewProjectsDetails
    ProjectID
    ProjectNo ProjectNo
    ProjectName ProjectName
    QuotedAmount QuotedAmount
    OrderNo OrderNo
    QuotedLabourAmount QuotedLabourAmount
    QuotedMaterialsAmount
    QuotedMaterialsAmount
    CompanyName CompanyName
    CompanyAddress CompanyAddress
    CompanySuburb CompanySurburb
    CompanyPostcode CompanyPostcode
    CompanyContact CompanyContact
    CompanyTel CompanyTel
    CompanyFax CompanyFax
    CompanyEmail CompanyEmail

    tblCompanyDetails frmNewCompanyDetails
    CompanyNameID
    CompanyName CompanyName (cboCompanyName)
    CompanyAddress CompanyAddress
    CompanySuburb CompanySuburb
    CompanyPostcode CompanyPostcode
    CompanyContact CompanyContact
    CompanyTel CompanyTel
    CompanyFax CompanyFax
    CompanyEmail
    CompanyEmail

    New Project Form Properties

    Name: cboCompanyName CompanyName
    Control Source:CompanyName CompanyName
    Row Source Type: Table/Query
    Row Scource: tblCompanyDetails
    ColumnCount: 8
    Column Heads: No
    Column Width: 0cm,4.05cm
    Bound Column: 0
    List Row: 8

    Record Scource = SELECT tblCompanyDetails.CompanyName, tblCompanyDetails.Address, tblCompanyDetails.Suburb, tblCompanyDetails.Postcode, tblCompanyDetails.Postcode, tblCompanyDetails.ContactPerson, tblCompanyDetails.TelephoneNo, tblCompanyDetails.FaxNo, tblCompanyDetails.EmailAddress FROM tblCompanyDetails;

    The frmProjectDetails save to the tblProjectDetails (ProjectNo, ProjectName, QuotedAmount, QuotedLabourAmount, QuotedMaterialsAmount, QuotedProfit are all ok) and the frmCompanyDetails ave to the tblCompanyDetails

  4. #4
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Combobox Selections Not Saving To Table

    Just adding to the last post as it sent before I was finished

    To summarize the frmCompanyDetails saves all the data to tblCompanyDetails ok.

    The frmProjectDetails saves all the project details but not the company details to the tblProjectDetails

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,924

    Re: Combobox Selections Not Saving To Table

    It appears that in your Combo Box that you don't have a bound column in the properties. Suggest you change the zero to a one.

    Additionally, why are you using don't you have the CompanyID in your lookup query. It is more efficient in a db to have the information as a numeric value and if you need the information in a query or report to display the company name to link the project table to the Company Name table using a primary key and foreign key. However, your method will still work.


    Alan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1