P
Paul
Hi,
I have a combobox in a subform that has the onchange, onupdate and ondirty
events enabled. The code updates the content of other fields in the subform
when the combobox is updated. The problem is these events do not occur when
the contents of the combobox changes due to the another event.
For example
I want the textboxes txtName, txtaddress1 and txtaddress2 to be updated when
the content of cmbUserID changes. The code I'm using is for the change,
dirty and update events is:
myArray = Array("Name","Address1", "Address2")
sFormName = Forms("frmThirdPartyReturns")("sfrm46GDetails")
i = 0
For i = 0 To 2
varx(i) = DLookup(myArray(i), "tblThirdPartyData", "[ThirdPartyID] = " &
sFormName("cmbThirdPartyID"))
sFormName(myArray(i)) = varx(i)
Next i
This works fine when I directly change the content either by typing or
selecting a userid in the combo box. I have a number of navigation command
buttons on the form. When I click on of these e.g. Next or previous record,
the content of the combobox changes but the content of the other fields does
not.
How can I get the code to run no matter how the content of the combobox
changes
Any advise appreciated
Paul
I have a combobox in a subform that has the onchange, onupdate and ondirty
events enabled. The code updates the content of other fields in the subform
when the combobox is updated. The problem is these events do not occur when
the contents of the combobox changes due to the another event.
For example
I want the textboxes txtName, txtaddress1 and txtaddress2 to be updated when
the content of cmbUserID changes. The code I'm using is for the change,
dirty and update events is:
myArray = Array("Name","Address1", "Address2")
sFormName = Forms("frmThirdPartyReturns")("sfrm46GDetails")
i = 0
For i = 0 To 2
varx(i) = DLookup(myArray(i), "tblThirdPartyData", "[ThirdPartyID] = " &
sFormName("cmbThirdPartyID"))
sFormName(myArray(i)) = varx(i)
Next i
This works fine when I directly change the content either by typing or
selecting a userid in the combo box. I have a number of navigation command
buttons on the form. When I click on of these e.g. Next or previous record,
the content of the combobox changes but the content of the other fields does
not.
How can I get the code to run no matter how the content of the combobox
changes
Any advise appreciated
Paul