0
I have a Datagridview that loads all the data of a table, all the data are of type Short Text in BD. I call for an SQL statement to display in Datagridview, until this step goes all right, everything is loaded and displayed perfectly!
The problem is when I select a record (entire line), and ask to return this record to a form that has the respective fields so I can edit them, for the fields in the form type Textbox goes smoothly, but the error occurs when I try display the contents in a Combobox. This is when the error in attachment occurs, and such error cannot be solved.
In this Combobox, it is restricted to 2 items only, YES and NO. Without any type of editing, only selection of items from the list.
In the Module:
Public intCodigoFornecedor As Integer ''TBL_Cadastrar_Fornecedores
No Form:
Private Sub PSelecionaFornecedor() ''Guarda o que foi selecionado
intCodigoFornecedor = CInt(dgvFornecedores.CurrentCell.Value.ToString())
Me.Dispose() ''Para esconder o Form
End Sub
Private Sub PSelecionaFornecedor() ''Guarda o que foi selecionado
intCodigoFornecedor = CInt(CType(dgvFornecedores.CurrentRow().Cells("Codigo_Fornecedor").Value, String))
Me.Dispose() ''Para esconder o Form
End Sub
I’ve tried these two ways and I can’t fix it, someone knows?
Right! Thank you very much! It worked!
– Rafael Rotti
For nothing. I could mark it as the right answer.
– Cassio Alves