Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

set the value of a field

Discussion in 'Information Technology' started by Joeb, Nov 8, 2005.

Tags:
  1. Joeb

    Joeb
    Expand Collapse
    Guest

    I have 2 tables, one has company info including a fee field. Then I have a
    table with inspections that include the company and the fee for that company.
    I have a form which I enter new inspections in. I have a combo box that I
    choose the company for each inspection.
    What I want to happen is the fee for the company I just selected to be put
    into the inspection fee field. I have tried using the setvalue function in a
    macro but I keep getting automation errors. I have a query that will select
    the fee from the company in the inspections form. So I have the value but I
    do not know how to get it to automatically show up in the inspection form
    [fee] field. Please help! I have been messing with this for months.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Settlement Leads To Peaceful Transition At Sikh Temple Breaking News Sep 10, 2016
    Sikhi Langar-Aid - Sikhs Have Set Up A 'Langar' In The ISIS Territory of Syria To Feed Refugees Sikh Sikhi Sikhism Oct 31, 2015
    A set back or a step forward Blogs Oct 17, 2015
    USA Sikh Cartoonist Sets Out To Fight Racial Bias Breaking News Mar 9, 2015
    India Who says we have skeletons only in our closets? Breaking News Aug 22, 2014

  3. tina

    tina
    Expand Collapse
    Guest

    the easy way: open your Inspections form in design view. in the Company
    combobox control, go to the RowSource property and add the Fee field from
    the Company table to the RowSource. don't forget to increase the ColumnCount
    property's value by 1. and in the ColumnWidths property, add
    ; 0"
    to the end of the value (so the additional column is included, but its'
    width is set to zero and it will not show in the droplist in form view).
    in the combobox's AfterUpdate event, add a macro or VBA code to set the
    value of the Fee control to the new column in the combobox, as

    Me!FeeControlName = Me!ComboboxName.Column(n)

    substitute the correct names of the controls, of course. change the (n)
    value to the index for the Fee column in the combobox; note that combobox
    columns are zero-based, which means that the first column (moving left to
    right) is indexed as (0), the second column is (1), the third column is (2),
    etc.

    hth


    "Joeb" <Joeb@discussions.microsoft.com> wrote in message
    news:C90FE86A-5477-430E-A34F-297679A28B31@microsoft.com...
    > I have 2 tables, one has company info including a fee field. Then I have

    a
    > table with inspections that include the company and the fee for that

    company.
    > I have a form which I enter new inspections in. I have a combo box that

    I
    > choose the company for each inspection.
    > What I want to happen is the fee for the company I just selected to be put
    > into the inspection fee field. I have tried using the setvalue function

    in a
    > macro but I keep getting automation errors. I have a query that will

    select
    > the fee from the company in the inspections form. So I have the value but

    I
    > do not know how to get it to automatically show up in the inspection form
    > [fee] field. Please help! I have been messing with this for months.
     
  4. Joeb

    Joeb
    Expand Collapse
    Guest

    This worked!!!! Thank you SOOOO much!!

    Joe

    "tina" wrote:

    > the easy way: open your Inspections form in design view. in the Company
    > combobox control, go to the RowSource property and add the Fee field from
    > the Company table to the RowSource. don't forget to increase the ColumnCount
    > property's value by 1. and in the ColumnWidths property, add
    > ; 0"
    > to the end of the value (so the additional column is included, but its'
    > width is set to zero and it will not show in the droplist in form view).
    > in the combobox's AfterUpdate event, add a macro or VBA code to set the
    > value of the Fee control to the new column in the combobox, as
    >
    > Me!FeeControlName = Me!ComboboxName.Column(n)
    >
    > substitute the correct names of the controls, of course. change the (n)
    > value to the index for the Fee column in the combobox; note that combobox
    > columns are zero-based, which means that the first column (moving left to
    > right) is indexed as (0), the second column is (1), the third column is (2),
    > etc.
    >
    > hth
    >
    >
    > "Joeb" <Joeb@discussions.microsoft.com> wrote in message
    > news:C90FE86A-5477-430E-A34F-297679A28B31@microsoft.com...
    > > I have 2 tables, one has company info including a fee field. Then I have

    > a
    > > table with inspections that include the company and the fee for that

    > company.
    > > I have a form which I enter new inspections in. I have a combo box that

    > I
    > > choose the company for each inspection.
    > > What I want to happen is the fee for the company I just selected to be put
    > > into the inspection fee field. I have tried using the setvalue function

    > in a
    > > macro but I keep getting automation errors. I have a query that will

    > select
    > > the fee from the company in the inspections form. So I have the value but

    > I
    > > do not know how to get it to automatically show up in the inspection form
    > > [fee] field. Please help! I have been messing with this for months.

    >
    >
    >
     
  5. tina

    tina
    Expand Collapse
    Guest

    you're so welcome! :)


    "Joeb" <Joeb@discussions.microsoft.com> wrote in message
    news:93774E1E-C067-4870-8CC1-60204B1A8AED@microsoft.com...
    > This worked!!!! Thank you SOOOO much!!
    >
    > Joe
    >
    > "tina" wrote:
    >
    > > the easy way: open your Inspections form in design view. in the Company
    > > combobox control, go to the RowSource property and add the Fee field

    from
    > > the Company table to the RowSource. don't forget to increase the

    ColumnCount
    > > property's value by 1. and in the ColumnWidths property, add
    > > ; 0"
    > > to the end of the value (so the additional column is included, but its'
    > > width is set to zero and it will not show in the droplist in form view).
    > > in the combobox's AfterUpdate event, add a macro or VBA code to set the
    > > value of the Fee control to the new column in the combobox, as
    > >
    > > Me!FeeControlName = Me!ComboboxName.Column(n)
    > >
    > > substitute the correct names of the controls, of course. change the (n)
    > > value to the index for the Fee column in the combobox; note that

    combobox
    > > columns are zero-based, which means that the first column (moving left

    to
    > > right) is indexed as (0), the second column is (1), the third column is

    (2),
    > > etc.
    > >
    > > hth
    > >
    > >
    > > "Joeb" <Joeb@discussions.microsoft.com> wrote in message
    > > news:C90FE86A-5477-430E-A34F-297679A28B31@microsoft.com...
    > > > I have 2 tables, one has company info including a fee field. Then I

    have
    > > a
    > > > table with inspections that include the company and the fee for that

    > > company.
    > > > I have a form which I enter new inspections in. I have a combo box

    that
    > > I
    > > > choose the company for each inspection.
    > > > What I want to happen is the fee for the company I just selected to be

    put
    > > > into the inspection fee field. I have tried using the setvalue

    function
    > > in a
    > > > macro but I keep getting automation errors. I have a query that will

    > > select
    > > > the fee from the company in the inspections form. So I have the value

    but
    > > I
    > > > do not know how to get it to automatically show up in the inspection

    form
    > > > [fee] field. Please help! I have been messing with this for months.

    > >
    > >
    > >
     

Share This Page