Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ComboBox value won't add to table (xp)

    I am creating a db to manage work placements. I have a form that allows the selection of an employer and a student from comboboxes which are then stored in a Placement table. I have added another combobox which allows the user to a select a predetermined date. The placement table has a field for this date but after saving the record, the date does not show in the Placement table, whereas the Employer and Student data do.
    Any ideas as to the error of my ways?
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox value won't add to table (xp)

    Has the date combo box been bound to the date field? In other words, has the Control Source of the date combo box been set to the name of the date field?

  3. #3
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox value won't add to table (xp)

    Hi Hans

    I've bound the combobox control source to the appropriate field in the Placement table - or at least I think so - but when trying to select one of the values I am informed that the "control can't be edited,it's bound to the expression "[tblPlacement][WeekID]".
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox value won't add to table (xp)

    If that is not a typo, there is something wrong - there should at least be a period between [tblPlacement] and [WeekID]. Try selecting the control source from the dropdown list.

  5. #5
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox value won't add to table (xp)

    It was a typo, sagacious one! The field name does not appear in the dropdown list. I'm trying to modify (functionalise) a db created by a student using wizards, for a colleague. I'm getting the impression that It would be better if I started from scatch instead of tweaking,but this problem, once fixed, should do the job.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox value won't add to table (xp)

    If the field name is not in the dropdown list, it is not in the record source of the form. I don't know enough to know if it's better to start from scratch in this specific situation, but it is often a good solution if things get tangled up.

  7. #7
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox value won't add to table (xp)

    The original recordsource is:

    SELECT DISTINCTROW [tblPlacement].[StudentID], [tblPlacement].[CompanyID], [tblCompany].[Company Name], [tblCompany].[Contact Name], [tblCompany].[Address1], [tblCompany].[Address2], [tblCompany].[Address3], [tblCompany].[PostCode], [tblCompany].[TelCode], [tblCompany].[TelNo], [tblStudent].[Surname], [tblStudent].[Forename], [tblStudent].[Tutor Group] FROM ([tblStudent] INNER JOIN ([tblCompany] INNER JOIN [tblPlacement] ON [tblCompany].[CompanyID] =[tblPlacement].[CompanyID]) ON [tblStudent].[StudentID] =[tblPlacement].[StudentID]);

    I am trying to include a value from tblWeek which is then stored in tblPlacement. I have tried to modify the recordsource thus:

    SELECT DISTINCTROW [tblPlacement].[StudentID], [tblPlacement].[CompanyID], [tblPlacement].[WeekID], [tblCompany].[Company Name], [tblCompany].[Contact Name], [tblCompany].[Address1], [tblCompany].[Address2], [tblCompany].[Address3], [tblCompany].[PostCode], [tblCompany].[TelCode], [tblCompany].[TelNo], [tblStudent].[Surname], [tblStudent].[Forename], [tblStudent].[Tutor Group] FROM ([tblStudent] INNER JOIN ([tblCompany] INNER JOIN [tblPlacement] ON [tblCompany].[CompanyID] =[tblPlacement].[CompanyID]) ON [tblStudent].[StudentID] =[tblPlacement].[StudentID]) ON [tblWeek].[WeekID]=[tblPlacement].[WeekID]);

    but I am getting a syntax error in the FROM clause. Am I on the right track?
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  8. #8
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox value won't add to table (xp)

    I'e managed to sort it out. Simply a matter of rebuilding the underlying query using the expression builder.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

Posting Permissions

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