Automatically Filling Form Fields in MS Access 201

2019-06-12 05:09发布

问题:

Hi I have a table Exhibit_Testing with the following fields:

1) ReferenceNo ( Automatic Number) 2) Region_Name 3) Branch_Code 4)Branch_Name 5) AOM 6) Observation 7) Status 8) Date_Recieved 9) Date_Checked

I want to create a Data Entry Form where if I enter Branch_Code then, Region_Name, Branch_Name, AOM are automatically filled.

Please help me in that. Thanks.

Update : The Branch_Code should be in Combo Box format.

回答1:

The Branch_Code combobox's RowSource property should be a query that returns all the fields you want to automatically fill in.

When a particular branch is selected from the combo use the AfterUpdate event to fill in the other fields as follows:

Private Sub cmbBranch_Code_AfterUpdate()
    txtRegion_Name=cmbBranch_Code.Column(1)
    ...
End Sub