Results 1 to 8 of 8
  1. #1
    Scotchegg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2022
    Posts
    3

    when selecting from a drop down list automatically enter the price for it

    I have a table called FixingsListT which has a list of fixings with the price each next to it.


    I then have a table called FixingsT which i select a fixing from a drop down list ( which is from FixingsListT ) i need the price each to be entered automatically from the FixingsListT how do i do this?

    Click image for larger version. 

Name:	Fixings List.PNG 
Views:	29 
Size:	40.1 KB 
ID:	48727Click image for larger version. 

Name:	Fixings.PNG 
Views:	27 
Size:	13.3 KB 
ID:	48728

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,997
    Bring in the amount as an extra column and refer to that column.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,570
    You should not be trying to do this in the Table.

    You would create a Data Input Form which would be based on the Table.

    Then in the Design of the Form you would use the Wizard to create a Combobox to Lookup the values from FixingsListT

    You would select both the FixingName and Price each

    Then you would refer to the ComboboxName to obtain the 2nd Column Value

    =[ComboboxName].Column(2)


    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,997
    Quote Originally Posted by mike60smart View Post
    You should not be trying to do this in the Table.

    You would create a Data Input Form which would be based on the Table.

    Then in the Design of the Form you would use the Wizard to create a Combobox to Lookup the values from FixingsListT

    You would select both the FixingName and Price each

    Then you would refer to the ComboboxName to obtain the 2nd Column Value

    =[ComboboxName].Column(2)


    2nd column would be (1) Mike?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,570
    Hi Welshgasman

    Strange I always thought that the Combobox would display in the following Order:-

    PK Column 0
    Fixingname Column 1
    Price Each Column 2
    Column Count 3
    Column Widths 0cm;2.54cm;2.54cm;
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,997
    Quote Originally Posted by mike60smart View Post
    Hi Welshgasman

    Strange I always thought that the Combobox would display in the following Order:-

    PK Column 0
    Fixingname Column 1
    Price Each Column 2
    Column Count 3
    Column Widths 0cm;2.54cm;2.54cm;
    Yes, that is correct and your second column has an index of 1. Your third column has the index of 2 ? Even your Column Count tells you 3, and the Price is the last column.

    You are confusing column count with index as the index starts at 0?
    So the way you have your columns arranged your syntax was correct, but you referred to the second column?, not the column indexed by the value 2, which is the third column. ?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,570
    My apologies

    It should have read as follows:-

    Then you would refer to the ComboboxName to obtain the 3rd Column Value
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  8. #8
    Scotchegg is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2022
    Posts
    3
    Brilliant thanks worked great.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-31-2024, 09:57 AM
  2. Replies: 3
    Last Post: 05-15-2017, 06:33 PM
  3. Replies: 2
    Last Post: 03-02-2015, 12:19 PM
  4. Enter result according to drop down list
    By frosty in forum Access
    Replies: 3
    Last Post: 10-12-2011, 07:38 AM
  5. Replies: 8
    Last Post: 09-24-2009, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums