TabControl VB.NET

AndreVSerafim

Power Member
Boas tou com umas duvidas (problemas) no VB e nao estou a conseguir dar a volta se alguem poder ajudar ;)

Aqui funciona e guarda na BD
Código:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] GravaRegisto()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ssql [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso o varlor do painel de abas seja 0 1 2 3 4 5 6 ele vai atribuir os dados respectivos
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TabControlConteudos.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 0
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuConteudosPessoais '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdContPes.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(TxtNota1ContPes.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(TxtNota2ContPes.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos conteudos pessoais ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 1
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuAgenda '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdAgenda.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtAgenda_Bold.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtAgenda_Norm.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_4.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_5.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Agenda_6.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba da agenda ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 2
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPagamentos '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdPagamentos.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtMBQuotas_Bold.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtMBQuotas_Norm.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtDDQuotas_Bold.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtDDQuotas_Norm.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtVISAQuotas_Bold.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtVISAQuotas_Norm.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos pagamentos de quotas ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 3
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdPontos.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtPontosS3G_Bold.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_LtPontosS3G_Norm.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos pontos s3g ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 4
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int ' "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt1.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt1.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int1_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int1_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int1_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int1_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt2.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt2.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int2_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int2_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int2_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int2_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt3.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt3.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int3_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int3_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int3_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int3_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos rebates s3g 1 ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 5
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt4.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt4.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int4_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int4_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int4_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int4_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt5.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt5.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int5_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int5_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int5_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int5_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt6.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LblIdInt6.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int6_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int6_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int6_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int6_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos rebates s3g 2 ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 6
ssql = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_iuPontos_Int '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LbIdInt7.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Val(LbIdInt7.Text)) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_De.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_A.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_1Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_1Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_2Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_2Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_3Descr.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Txt_Int7_3Pontos.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int7_1.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int7_2.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"', '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Trim(Foto_Int7_3.Text) & [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"'"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]gravarregisto_sql(ssql)
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos rebates s3g 3 ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/COLOR][/SIZE]

Mas aqui ja nao da..fiz o breakpoint e ele nao reconhece as tabs a nao ser a primeira
Código:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LeituraRegisto()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] abrev [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Indices [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = TabControlConteudos.SelectedIndex
dbConn = OpenSqlConnection()
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'verificar se a BD esta aberta
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dbConn.State = ConnectionState.Closed [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]dbConn = OpenSqlConnection()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dbConn.State = ConnectionState.Closed [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]MsgBox([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Ligação à base de dados falhou"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MsgBoxStyle.Critical)
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Exit[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sqlQuery [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]""
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'iniciar o comando SQL
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sqlCommand [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'iniciar o leitura SQL
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sqlDataReader [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlDataReader
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Indices
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 0
sqlQuery = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_vConteudosPessoais"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]abrev = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"CPES"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
sqlDataReader.Close()
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos conteudos pessoais ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 1
sqlQuery = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_vAgenda"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]abrev = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"AGEN"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
sqlDataReader.Close()
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba da agenda ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 2
sqlQuery = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_vPagamentos"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]abrev = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"PAGM"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
sqlDataReader.Close()
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos pagamentos de quotas ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 3
sqlQuery = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_vPontos"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]abrev = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"PONT"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
sqlDataReader.Close()
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos pontos s3g ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 4, 5, 6
sqlQuery = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"sp_vPontos_Int"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]abrev = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"PNTI"
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
sqlDataReader.Close()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Data.SqlClient.SqlCommand(sqlQuery, dbConn)
sqlDataReader = sqlCommand.ExecuteReader
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sqlDataReader.Read [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Indices
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 0
TxtNota1ContPes.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Nota1ContPes"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
TxtNota2ContPes.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Nota2ContPes"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba dos conteudos pessoais ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 1
Txt_Agenda_1.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Agenda_2.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_2"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Agenda_3.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_3"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Agenda_4.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_4"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Agenda_5.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_5"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Agenda_6.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_6"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtAgenda_Bold.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_Bold"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtAgenda_Norm.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Agenda_Norm"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Caso seja a aba da agenda ele ira aceder a respectiva tabela
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 2
Txt_LtMBQuotas_Bold.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"MBQuotas_Bold"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtMBQuotas_Norm.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"MBQuotas_Norm"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtDDQuotas_Bold.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"DDQuotas_Bold"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtDDQuotas_Norm.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"DDQuotas_Norm"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtVISAQuotas_Bold.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"VISAQuotas_Bold"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtVISAQuotas_Norm.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"VISAQuotas_Norm"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 3
Txt_LtPontosS3G_Bold.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"PontosS3G_Bold"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_LtPontosS3G_Norm = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"PontosS3G_Norm"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 4, 5, 6
Txt_Int1_De.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_De"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Int1_A.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_A"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_1.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_Imagem1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_1.Load([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"C:\Projectos.VB2005\Extra\Imagens\"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Foto_Int1_1.Text)
Txt_Int1_1Descr.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_1Descr"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Int1_1Pontos.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_1Pontos"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_2.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_Imagem2"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_2.Load([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"C:\Projectos.VB2005\Extra\Imagens\"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Foto_Int1_2.Text)
Txt_Int1_2Descr.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_Int_2Descr"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Int1_2Pontos.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_2Pontos"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_3.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_Imagem3"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Foto_Int1_3.Load([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"C:\Projectos.VB2005\Extra\Imagens\"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] & Foto_Int1_3.Text)
Txt_Int1_3Descr.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_3Descr"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
Txt_Int1_3Pontos.Text = sqlDataReader([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Int_3Pontos"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Select
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'fechar a conecçao
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]sqlDataReader.Close()
dbConn.Close()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/COLOR][/SIZE]

O objectivo é que cada vez que ele muda de tab ele coloque la nas text os ultimos dados escritos antes de fechar o programa

(no SQL tenho as tabelas a por os ids por ordem decrescente para me dar sempre o ultimo inserido e mostrar logo esse)
Agora pa esta situaçao alguem pode ajudar ou dar uma dica de onde posso ir verificar onde esta a anomalia?
 
Confirma se a variável Indices está realmente a guardar o valor do índice da tab seleccionada.
Provavelmente ele apenas entra na primeira porque está a assumir o valor default do tipo integer 0.
 
Confirma se a variável Indices está realmente a guardar o valor do índice da tab seleccionada.
Provavelmente ele apenas entra na primeira porque está a assumir o valor default do tipo integer 0.
Parabens alguem pelo menos respondeu menos mal mas entretanto acabei por resolver o problema da forma mais simples

Código:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TabControlConteudos_Click([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Object[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TabControlConteudos.Click
LeituraRegisto()
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/COLOR][/SIZE]

Mas obrigado na mesma pelo menos alguem respondeu a alguma coisa por aqui ;)
 
Back
Topo