Results 1 to 6 of 6

Thread: Access Forms

  1. #1
    Join Date
    Aug 2008
    Posts
    9

    Unanswered: Access Forms

    I have a form that was made by a query and in the form I created a combobox that gets it information from a table. I want the choice of the combo box to go back to the query in a column that gets created when the query runs.
    (if it helps i copied the sql view of the query here)
    SELECT [qryUpdateCompanyOneTable w/sequence].Sequence, [qryUpdateCompanyOneTable w/sequence].Company, [qryUpdateCompanyOneTable w/sequence].[Total Revenue], [qryUpdateCompanyTwoTable w/sequence].Sequence, [qryUpdateCompanyTwoTable w/sequence].Company, [qryUpdateCompanyTwoTable w/sequence].[Total Revenue], *
    FROM [qryUpdateCompanyOneTable w/sequence] LEFT JOIN [qryUpdateCompanyTwoTable w/sequence] ON [qryUpdateCompanyOneTable w/sequence].Company = [qryUpdateCompanyTwoTable w/sequence].Company;

    (what the query doesn't have is the mention of the new column), this is my problem I believe I don't know what the correct syntax would be to create the column in order for the form to update it.

    If anything else is needed to help please let me know

    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry I don't understand what yu are trying to do
    you have a form, populated by a query
    you have a combo box on that form populated by a query.

    what I don't understand is....
    especially the bit in red
    I want the choice of the combo box to go back to the query in a column that gets created when the query runs.
    if the query doesn't have the new column then add it with a comma preceeding it
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2008
    Posts
    9
    I guess that is where I'm stuck I don't know how to add it. Can you give me the code?

    Thanks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    where / how did you get the sql you posted above?
    if its was in the query designer either drag the relevant column from the table (making certain the 'show' column' box is ticked) or switch to SQL view and add the column there eg
    [qryUpdateCompanyTwoTable w/sequence].[Total Revenue], mynewcolumn

    Im not a fan of "select *" in a query.... I'd far rather explcitly define the columns I want in my queries
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    STARTrekker loves the STAR!!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    in the form I created a combobox that gets it information from a table. I want the choice of the combo box to go back to the query in a column that gets created when the query runs.
    For this, you just need to modify the RowSource property of your combo box to the SQL you want it to look at. Use the three little dots button to build it just like any query... selecting the columns you want from any table or query you have.

    I don't know what the correct syntax would be to create the column in order for the form to update it.
    This sounds like you might not realise that you cannot update a calculated field. You can't update calculated fields any more than you can change the 3 in 1+2=3. You can change the 1 and/or the 2, but not the 3.

    Of course, I could be completely misunderstanding what you are after here
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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