Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
Binding problem after assigning value to a bound field
posted

Hi

I have a sample vs 2008 vb.net winform project at http://www.infovis.biz/Test%20EMS.zip.

If you run the project you will see a form with some sample data. Use the buttons in the form’s bottom area to scroll through the records. Everything works fine. You can even change text in fields and moving away from record will save it.

Now go back into project and uncomment line 123 in frmStaff.vb ie

        Me.txtRate.Value = CStr(DLookup("[Rate]", "[Rates]", "[Rate ID] = """ & txtRateID.Value.ToString & """"))

Now run the project and scroll through records. Soon you will see that information stops appearing in fields. The purpose of above line is that when user selects a Rate ID from the drop down then the system looks up the corresponding Rate Amount and fills the Rate field with it. So my question is, why is this lookup causing this problem and what is the correct way to lookup a value and assign it to a bound field without causing this problem?

Thanks

Regards


Yahya

PS: The project needs to be extracted in C:\ folder so the project ends up in C:\Test EMS folder.