Retrieve and display data without tbl messed up
I would like to use a code selected in Form 2 to retrieve the data in a table and display the row on Form 1. I have trouble to have the data shown on Form-1 without backend table messed up after selecting a code from Form-2.
Here are the table and Forms,
Name Type Definition Parent
DI A1 Text 1 PD
ED A2 Text 2 DI
PM A2 Text 3 DI
Form-1 (Single Form):
The form Includes: Text Fields, a Combo box and buttons (such as Delete)
Record Source: SELECT myDb.definition, myDb.parent, myDb.type FROM myDb WHERE myDb.name = Forms![Form-1]! cbxNm
Combo box, cbxNm: include a list of Name of myDb, DI, ED, PM. …,
Combo box properties:
2. Row Source Type: Table/Query
3. Row Source: SELECT myDb.Name FROM myDb WHERE myDb.Type = Forms![Form-1]!Type ORDER BY myDb.Name
How to work:
1. Select “DI” from the combo box
2. Type = “A1”, Definition = “Test 1", Parent = “PD” are displayed in text fields of Form-1
3. Click on Delete button to retrieve the information of where “DI” is being used, and open Form-2 to display the data on it
Display the where used information in a tabular format:
Deleted code Name something else
------------ -------- ------------------
DI ED ….
DI PM ….
How to work:
1. Double click a Name, for example “PM”
2. Focus shifts to Form-1
3. "PM” is focused and highlighted on the combo box
4. Display PM related information in the text fields on Form-1 (???)
I expected the related information of “PM”, Type = A2, Definition = Test 3 and Parent-class=”DI”, are displayed on Form-1 after “PM” is focused on combo box. I tried to use “PM” as key for SQL selection to get data and used form’s setValue to set the data on each text field of Form-1. Front end looked ok, but table myDb was messed up. How can I change it?
Thanks in advance for suggestions.