Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45

    Issue when using dropdown box on a form

    Hello
    I hope I can explain this clearly. I have a form that updates 1 table Major Gas. Most data comes from other tables. The data source of the form is a query of multi tables.
    If the user changes a selection of a drop down box, the screen reflects the fields from the table correctly, but what is happening ..as an example
    Major Code is a drop down from table Pure Gas when record is first presented on the form it is A4 with a price of $10.34.
    User changes this Major Code to A5 which has a price of $8.08. What is happening is record A4 's price is being changed to $8.08 in the Pure Gas table.


    I am confused why this table is being changed at all.
    I hope I have explained this correctly.

    Thank you!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,776
    Most of the time you use combos to choose list items and then do things like filter records or choose list values to save in a new record, thus you do not bind them to anything (do not use the combo controlsource property). If you bind them you will set whatever field you've bound it to become the new chosen value. Forms with unbound controls usually need code to save or edit a record using the unbound data.

    If you need to bind in your situation, then you must either realize the result of choosing a different value, or you need to use a single form view and disable them for existing records and enable them for new records or if you can, swap form mode from view to edit and disable/enable accordingly.
    HTH
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45
    Thank you. I apologize for my lack of knowledge. If I just want the user to be able to select a record by using a drop down box, but not change any records in the table of the source of that drop down box, how should I be creating the drop down box?
    Perhaps I should be using a List Box, not a combo box?

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi
    Can you upload a zipped copy of the database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,776
    how should I be creating the drop down box?
    As mentioned, do not have anything set for the control source property. If it already filters (selects?) your records it should still do so without a controlsource property. Open the form in design, select the combo and remove whatever is showing on the property sheet for that control. If that doesn't work then maybe you will have to post a zipped db copy as suggested - you haven't said if this was a single form, split form, or main form/subform.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45
    Gas_Test.zip

    I hope I attached the zip file correctly. It is a scaled down version. Open frm_Main, select a record..the form I am having issues with will open..it is Gas_Master.

    Thank you!

  7. #7
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    I opened the Gas Master Form but it does not have any Combobox in the detail area?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  8. #8
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    I have modified the Gas Master Form which now has 2 Combobox's. 1 for selecting the Category and the other for selecting the Cycle.
    Attached Files Attached Files
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  9. #9
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45
    Quote Originally Posted by mike60smart View Post
    Hi

    I have modified the Gas Master Form which now has 2 Combobox's. 1 for selecting the Category and the other for selecting the Cycle.
    Actually the form has @ 10 combo boxes on it. The one in question is cbo_majcd0

  10. #10
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    In the Db that you uploaded you said select frmMain - then select a record?

    When I select frm Main there is a Command Button to open the Gas Maintenance Form.

    It is this Form that I have updated.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  11. #11
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    It is the Master Cost File Maintenance Form where you have the problem.

    I just looked at it and this indicates that the table "PGAS000" needs to be normalised.

    The screenshot of the Controls indicates that you have what is known as Repeating Groups.

    Instead of fields in you PGAS000 table they should be records in a related table.
    Attached Thumbnails Attached Thumbnails GasCodes.JPG  
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  12. #12
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would strongly suggest/recommend that you stop and normalize the tables, fix the field names, field types and the relationships.


    This image is for the look up Tables
    Click image for larger version. 

Name:	Relationship1.png 
Views:	40 
Size:	185.3 KB 
ID:	43460


    This image is for the related Tables
    Click image for larger version. 

Name:	Relationship2.png 
Views:	38 
Size:	140.6 KB 
ID:	43461

  13. #13
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45
    Quote Originally Posted by mike60smart View Post
    Hi

    It is the Master Cost File Maintenance Form where you have the problem.

    I just looked at it and this indicates that the table "PGAS000" needs to be normalised.

    The screenshot of the Controls indicates that you have what is known as Repeating Groups.

    Instead of fields in you PGAS000 table they should be records in a related table.


    Thank you. This data was downloaded from another system. I will look into normalization.

  14. #14
    MEMFBI is offline Advanced Beginner
    Windows 10 Access 2003
    Join Date
    Apr 2020
    Posts
    45
    Quote Originally Posted by ssanfu View Post
    I would strongly suggest/recommend that you stop and normalize the tables, fix the field names, field types and the relationships.


    This image is for the look up Tables
    Click image for larger version. 

Name:	Relationship1.png 
Views:	40 
Size:	185.3 KB 
ID:	43460


    This image is for the related Tables
    Click image for larger version. 

Name:	Relationship2.png 
Views:	38 
Size:	140.6 KB 
ID:	43461

    Thank you . I will read up on normalization.

  15. #15
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

    First, my apologies. I spent a lot more time looking at your dB and realized the "Related Tables" appear to be multiple copies of table "PGASC02" (because of the repeating fields)and are Look up Tables.
    Only the table "Gas_Notes" (with its repeating fields - which should be redesigned) is a related table.

    Your design is not how I would design the tables. I shouldn't have said "Bad design".
    My tables (99.98% of the time) have a PK field of type Autonumber. See Microsoft Access Tables: Primary Key Tips and Techniques

    I have been working on your dB..... if/when I get time I'll post it. I have deleted all of the records just to make it easier to add/change fields/relationships.


    It looks, to me, like "PGAS000" is the main table. See if this helps any.
    There are 70 fields (if I counted correctly) in the table, so I had to do a little cutting and pasting to get all of the fields in the image.....
    Click image for larger version. 

Name:	TableDesign1.png 
Views:	35 
Size:	163.0 KB 
ID:	43463

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 10-23-2017, 06:32 PM
  2. Perplexing Combo Box Dropdown issue
    By GraeagleBill in forum Programming
    Replies: 3
    Last Post: 10-29-2015, 06:35 PM
  3. Replies: 1
    Last Post: 07-09-2014, 03:36 PM
  4. form dropdown problem!
    By aoken1 in forum Forms
    Replies: 3
    Last Post: 02-22-2013, 06:43 PM
  5. Form dropdown selection
    By piper in forum Forms
    Replies: 2
    Last Post: 04-16-2011, 09:34 AM

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