updating a comboBox contents in runtime ?

saleemMSMS

Registered User.
Local time
Today, 19:01
Joined
Aug 12, 2009
Messages
92
ok i have a form with following details
MemberID
MemberName
Bank Account
bankName
Age
Address

the bankName field is connected with the another form called banks
it has the following

bankID
bankName

PLEASE NOTE
-------------
actually, in the member table it is the BankID. in the member form there is a combo box where the bounding source is for bankID but what displays is bankName.

all the columns in the Member form are validated and no nulls are allowed.

in front of the BankName Combo box, there is a small button which will direct the DEO to the bank form. so whenever a bank is not present, the DEO can click the button, go to the banks form and then add the new bank details.

but when he does this and returns back to the member form, the newly added detail is not loaded to the comboBox.

i wrote this code for both the onCurrent event of the form as well as the afterUpdate event of the comboBox

Code:
Me.Refresh

but the following errors popin
"members.Age cannt be null"
"members.Address cannot be null"

what is the way that i can load the contents to the page ?

also i tried allowing nulls , but then the error messges dont appear but still the combo Box does not get updated...

please help me in this issue...
 
You code is telling the whole form to refresh. What you want is to requery (not refresh) the combo box.

me.ComboBoxName.requery

Substitute ComboBoxName with the actual name of the combo box on your form.
 

Users who are viewing this thread

Back
Top Bottom