Question on auto populate filed in a Form

aneesr

New member
Local time
Today, 17:25
Joined
Oct 7, 2014
Messages
4
Hi,

If someone can help in regard to the following problem I would really appreciate it.

I have 2 Tables with following fields

Table [APM]: apm_id, apm_owner, apm_values
Table [DATA]: apm_id, serv_name, serv_place, serv_choice, serv_role

Both tables are joined with 1 to 1 relations based on apm_id as both of the fields are same. The table [APM] is pre filled with data. The idea is to list data from [APM] and collect data from user to be saved in [DATA] based on the info from [APM].

I created a form which list all the fields from both tables. The fields from table [APM] are only for displaying data and created a combo box based on [APM].apm_id to display the fields by chosing an APM ID from the drop down box.

PROBLEM

A user adds a record and moves on to second record, completes the second record. Now if the user wants to list the first record by chosing the APM ID from the drop down box it only populates the fields from table [APM] but not the fields from table [DATA] which the user just added. Infect the fields related to table [APM] changes, but the fields from table [DATA] stays the same.

How ever if I click on the small arrows on the bottom which lets you cycle through records than it populates all the fields from both tables correctly.

How can I fix the issue so that all the fields would populate based on APM ID selected from drop down box.

Thank you.
 
Hello,

You must update your combo box when it receive the focus.
Put the code Me.YourComboBox.Requery on the SetFocus event of your combo.
It fixe your problem.

Have good continuation.
 
Hello,

You must update your combo box when it receive the focus.
Put the code Me.YourComboBox.Requery on the SetFocus event of your combo.
It fixe your problem.

Have good continuation.

The field under event is listed as "On Got Focus", there is nothing called SetFocus. I tried the code but it still the same did not work.

Here is the code I tried.

Private Sub tech_cbo_apm_id_GotFocus()
Me.tech_cbo_apm_id.Requery
End Sub
 
Are there any other settings or code to fix this issue? Any help?
 

Users who are viewing this thread

Back
Top Bottom