Jump to content
Fórum Script Brasil
  • 0

Pq Nao Esta Deletando


mestre fyoda

Question

3 answers to this question

Recommended Posts

  • 0
não apresenta nenhum erro , simplismente não deleta .

porque isso ocorre ?

Private Sub ListView_Click()

exclui_hora = ListView.SelectedItem

End Sub

Private Sub Excluir_Click()

deleta = " Delete * from Agendar_Consulta where hora = '" & exclui_hora & "' "

End Sub

Porque você *não* está mandando deletar... Você cria a instrução SQL ali certinha, mas onde você manda *executar* ela?

Abraços,

Graymalkin

Link to comment
Share on other sites

  • 0

pode trancar .

ai vai a resolução do problema

Public Sub Cancela_Agendamento(Formulario As Form)

valor = Agendamento.ListView.SelectedItem

SQL = cn.Execute("Delete * from Agendar_Consulta where hora ='" & valor & "'")

Agendamento.ListView.ListItems.Clear

Set rs = cn.Execute(" Select  * from Agendar_Consulta where DateValue(data) = DateValue('" & Date & "') ORDER BY hora ASC  ")

Set rs2 = cn.Execute(" Select * from Hora ")

    While Not rs.EOF And Not rs2.EOF

       

          If rs.Fields("hora").Value = rs2.Fields("hora").Value Then

          Set item = Agendamento.ListView.ListItems.Add(, , rs("hora"))

          item.ListSubItems.Add , , rs("nom_pac")

          item.ListSubItems.Add , , rs("data")

          item.ListSubItems.Add , , rs("tel_res")

          item.ListSubItems.Add , , rs("tel_com")

          rs.MoveNext

          rs2.MoveNext

         

          Else

 

          Set item = Agendamento.ListView.ListItems.Add(, , rs2("hora"))

          rs2.MoveNext

          End If

        Wend

       

      While Not rs2.EOF

    Set item = Agendamento.ListView.ListItems.Add(, , rs2("hora"))

          rs2.MoveNext

        Wend

End Sub

Private Sub Excluir_Click()

Call Cancela_Agendamento(Agendamento)

End Sub

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...