0
votes

Although a straight forward task, for a reason unknown to me I cannot update/refresh the combo box.

For the sake of simplicity, lets assume I have a table with a primary key, lets call it PK_Number (it is an integer number) and then I have 7 fields (6 field are required to fill in) of various types. Thus all of the fields belong to a single table.

The PK_Number field I made it a combo box. I did this because when any PK_Number is chosen from the drop down list all the other field should change accordingly

When I try to build an After Update event with the macro builder and choose the Requery command I get the two following pop ups enter image description here

enter image description here

Now, it is highly unlikely that the database is read only. i made the db and did not make such a thing. There are couple more questions i want to ask but first i need to overcome this obstacle.

ALthough initialy the row source of combo box belonged to a junction table, i also changed the row source to the master table but without any luck

Can anybody help me out? Thank you!!

1

1 Answers

0
votes

i was able to solve it.

generally speaking the method is to avoid using macros and use VBA instead :-)

besides the fun: i made a form with all the needed fields. however i also made an additional combo box that will be used to search all records and when the PK changes to change all other related fields

Lets suppose that the combo box name is cbo_PRF_Number. in the after update event i typed the below procedure.

Private Sub cbo_PRF_Number_AfterUpdate()
    If Not IsNull(Me.cbo_PRF_Number.Value) Then
        Me.txt_PRF_Number.SetFocus
        DoCmd.FindRecord Me.cbo_PRF_Number.Value
    End If

End Sub

Kindly note that in order for the above to work it is needed to make a bound text box with the same ow source as the combo box.