USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Problema de Lógica
fjralberto
SANTO ANDRÉ
SP - BRASIL
ENUNCIADA !
Postada em 06/06/2008 17:45 hs            
hauahu... eu estou tentando até assim oh!




Dim qtd_linha, acum, i As Integer

acum = 0

With Grid


    If linhas_cont = 1000 Then
    'Ao chegar nas 1000 linhas não será mais inserido linhas.
    Else

        If cboMes.Text = Empty Then
        MsgBox "Antes de incluir linhas, selecione o mês, em seguida escolha o ID da Demanda.", vbCritical, "Aviso" 'Caso o usuário não tenha escolhido o mês, ele não poderá inserir linhas.
        Else
          
            If .Rows = 1 Then
            .Rows = 2
            .TextMatrix(1, 1) = cboDemanda.Text
            qtd_linha = .Rows + 1
            Else
                For i = 1 To .Rows - 1
                    If .TextMatrix(i, 1) = cboDemanda.Text Then
                    MsgBox "Não é possível adicionar mais de um ID da Demanda por mês.", vbCritical, "Aviso"
                    acum = acum + 1
                    End If
                Next i
            End If
        End If
    End If
          
    If acum = 0 Then
    .Rows = qtd_linha + 1
    .TextMatrix(qtd_linha, 1) = cboDemanda.Text
    End If



End With


Mas o erro é o msm.... DROGA!

Alberto

"Em tijolo em tijolo a casa sai!"
Autor: Eu mesmo.
   
fjralberto
SANTO ANDRÉ
SP - BRASIL
ENUNCIADA !
Postada em 06/06/2008 17:49 hs            
Não funcionou ainda... ele está gerando a linha em branco e dando erro de RANGE ....hauhuhuah


Uma hora a gente consegue!!!!



QUEGUEI A UMA CONCLUSÃO A ALGUM TEMPO... LÓGICA É QUE NEM MULHER, COMPLICADA DE ENTENDER E SEMPRE TEM RAZÃO!

Alberto

"Em tijolo em tijolo a casa sai!"
Autor: Eu mesmo.
   
Treze
Pontos: 2843 Pontos: 2843
SÃO VICENTE
SP - BRASIL
ENUNCIADA !
Postada em 06/06/2008 17:57 hs            
Estou fazendo uns teste aqui e já descobri o erro agora só falta colocar a solução, mais uns dois minutos e estará resolvido.
TÓPICO EDITADO
 
Treze
Pontos: 2843 Pontos: 2843
SÃO VICENTE
SP - BRASIL
ENUNCIADA !
Postada em 06/06/2008 18:25 hs            
Eis a solução colega agora funciona na boa
 
Private Sub cmdIncLinha_Click()
Dim linhas_cont, i As Integer
With Grid
   
    If linhas_cont = 1000 Then
    'Ao chegar nas 1000 linhas não será mais inserido linhas.
    Exit Sub
    End If
        If cboMes.Text = Empty Then
        MsgBox "Antes de incluir linhas, selecione o mês, em seguida escolha o ID da Demanda.", vbCritical, "Aviso" 'Caso o usuário não tenha escolhido o mês, ele não poderá inserir linhas.
       Exit Sub
       End If
      For i = 1 To .Rows - 1
          If .TextMatrix(i, 1) = cboDemanda.Text Then
          MsgBox "Não é possível adicionar mais de um ID da Demanda por mês.", vbCritical, "Aviso"
          Exit Sub
      End If
      Next i
     .Rows = .Rows + 1
     .TextMatrix(.Rows - 1, 1) = cboDemanda.Text
End With
End Sub
   
luiz
não registrado
ENUNCIADA !
Postada em 08/06/2008 10:10 hs   
é pau na xota aspira!
   
fjralberto
SANTO ANDRÉ
SP - BRASIL
ENUNCIADA !
Postada em 09/06/2008 09:42 hs            
Eiiiiiiiitaaaaaaaaaa.... Deu certíssimo... caramba mew... é fogo o negócio ein!

huahuahuah

Um grande abraço TREZE!

VLW

Alberto

"Em tijolo em tijolo a casa sai!"
Autor: Eu mesmo.
   
Página(s): 3/3     « ANTERIOR  

CyberWEB Network Ltda.    © Copyright 2000-2024   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página