locked
Form Description RRS feed

  • Question

  • I have a form with 15 stations, something like ST01, ST02, etc., but i would like to insert a text box to show the station description (field value in a different table) if the operator select or type on station like ST01 the text box shows the description of that ST01, (ex: cutting) and when the operator click or type on the second station ST02, (ex: glue) but the description only needs to show as reference without the operator to be able to select it. I have no idea how to do it.

    Thanks 


    Fernando Salgueiro

    Friday, August 4, 2017 9:48 PM

Answers

  • Hi Fernando,

    You can set the following properties of the Textbox, so the user can't select it:

    Enabled = No
    Locked = Yes

    To display a value from another table, see if you can use the DLookup() function.

    Hope it helps...

    Saturday, August 5, 2017 12:50 AM
  • Hi FSalgueiro,

    you had mentioned that,"if the operator select or type on station like ST01 the text box shows the description of that ST01, (ex: cutting) and when the operator click or type on the second station ST02, (ex: glue) but the description only needs to show as reference without the operator to be able to select it."

    so do you mean that operator should not be able to select and modify it and you just want to display the description for the information.

    if your textbox is unbound and you are using the code to fetch the description then you can use Label.

    Label Object (Access)

    note that for each description , you need to fetch it from table using code and assign to label.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by FSalgueiro Monday, August 14, 2017 11:28 AM
    Monday, August 7, 2017 1:49 AM

All replies

  • Hi Fernando,

    You can set the following properties of the Textbox, so the user can't select it:

    Enabled = No
    Locked = Yes

    To display a value from another table, see if you can use the DLookup() function.

    Hope it helps...

    Saturday, August 5, 2017 12:50 AM
  • Are you saying that you have 15 separate column in a table, one for each station?  If so the table design is fundamentally incorrect as data is being encoded as column headings.  A fundamental principle of the database relational model is the Information Principle (Codd's Rule #1). This requires that all data be stored as values at column positions in rows in tables, and in no other way.

    What you appear to have is a many-to-many relationship type between whatever entity type the form's table is modelling and stations.  The relationship type should be modelled by a separate table which resolves the relationship type into two one-to-many relationship types.  The table modelling the relationship type would thus have two foreign keys, one referencing the primary key of the form's table, the other referencing the primary key of a stations table in which there would be multiple  rows, one for each station.

    The interface would be a form, in single form view, based on the form's current table (from which the multiple station columns have been removed) and, within the form a subform, in continuous forms view based on a query which joins the table modelling the relationship type to the stations table.  The subform would include a combo box to select the station along with other editable controls for any other attributes of the relationship type, and read-only controls bound to whatever other columns from the stations table you wish to show in the form.  The station name would not need a separate control, however, as the combo box bound to the foreign key StationID column or similar would be set up to hide the key and show the station name.  Controls can be made read-only by setting the Locked property to True (Yes) and the Enabled property to False (No).  Once a station is selected in the combo box these read-only control would show other values from the referenced row in the stations table.

    As few or as many related stations as required can be selected simply by inserting a row in the subform for each.

    Ken Sheridan, Stafford, England

    Saturday, August 5, 2017 12:41 PM
  • Hi FSalgueiro,

    you had mentioned that,"if the operator select or type on station like ST01 the text box shows the description of that ST01, (ex: cutting) and when the operator click or type on the second station ST02, (ex: glue) but the description only needs to show as reference without the operator to be able to select it."

    so do you mean that operator should not be able to select and modify it and you just want to display the description for the information.

    if your textbox is unbound and you are using the code to fetch the description then you can use Label.

    Label Object (Access)

    note that for each description , you need to fetch it from table using code and assign to label.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by FSalgueiro Monday, August 14, 2017 11:28 AM
    Monday, August 7, 2017 1:49 AM