Hello all,
I have two tables, one is roominfo and the other is roomtypes.
Each table has about 10 fields, and have a relationship based on one field in each.
I have added a qurey that links the two table together, all records in the roominfo are shown in the query. The linked field has a combobox(row source equal to one field in roomtypes) that looks up data in the roomtypes, which allow the user to select the type of room, then populates the the query record.
I have builtd a form that thats looks at the query, in the form you fill out the room info data, and the you use the combobox to select the room types. When the room type is selected, it populates the rest of the textboxes.
What I would like to do is be able to overwrite the tetxboxes in the form that are populated based on the combobox. I need to able to override some data but if I override them, it changes the roomtype data. I want the roomtype data to remain and not be changed.
I first did this with just the using control source, then I detemriend that I should use VBA code, so that I can be able to overwrite them in the form, and then linke them to the roominfo table instead. I just use the roomtypes with a dlookup to populates the form.
Also, when I overwrite certain textboxes, I want the text to change color so that I know whichs ones were overwritten. Then if I enter say an * in the textbox, i want the textbox to revert back the roominfo table..
I know that I this can be down with vba code, but it was starting to get complex with my code. Is ther a better way to go than this way.
I have two tables, one is roominfo and the other is roomtypes.
Each table has about 10 fields, and have a relationship based on one field in each.
I have added a qurey that links the two table together, all records in the roominfo are shown in the query. The linked field has a combobox(row source equal to one field in roomtypes) that looks up data in the roomtypes, which allow the user to select the type of room, then populates the the query record.
I have builtd a form that thats looks at the query, in the form you fill out the room info data, and the you use the combobox to select the room types. When the room type is selected, it populates the rest of the textboxes.
What I would like to do is be able to overwrite the tetxboxes in the form that are populated based on the combobox. I need to able to override some data but if I override them, it changes the roomtype data. I want the roomtype data to remain and not be changed.
I first did this with just the using control source, then I detemriend that I should use VBA code, so that I can be able to overwrite them in the form, and then linke them to the roominfo table instead. I just use the roomtypes with a dlookup to populates the form.
Also, when I overwrite certain textboxes, I want the text to change color so that I know whichs ones were overwritten. Then if I enter say an * in the textbox, i want the textbox to revert back the roominfo table..
I know that I this can be down with vba code, but it was starting to get complex with my code. Is ther a better way to go than this way.
Attachments
Last edited: