PDA

Click to See Complete Forum and Search --> : "unable to bind to field or data member" error with combobox


666539
Oct 16th, 2000, 03:05 PM
I have an app that is using comboboxes to validate user input to a SQL Server 7.0 database. Everything runs fine when I have at least 1 record in the table it is binding to. When there are no records in the table I get an error that says "Unable to bind to field or data member 'fieldname'"

I only get this error when the database is empty. Can anyone tell my why the combobox is getting this error. Is there anything I can do to set it up differently so it can connect to an empty recordset.

By the way, I am using ADO and VB6. I am also using datacombo boxes in the same form. They work fine. The reason I'm using comboboxes is because I didn't find a way to include a list in a datacombo box.

666539
Oct 16th, 2000, 03:41 PM
I think I may have solved my problem. If the combobox is bound to the recordset in the form_load event the errors do not occur. The error occurs if the datasource is set at design time, but not at run time.

I'm not sure why the errors occur, but this seems to be a work around for now.