vasco16 Posted May 9, 2009 at 09:09 PM Report #262735 Posted May 9, 2009 at 09:09 PM Boas pessoal alguem sabe porque é que este código nao está a funcionar? ele não me avalia. Private Sub Guardar825955_Click() Dim dbcurrent As DAO.Database Dim req As DAO.Recordset Dim mensagem As String Set dbcurrent = CurrentDb Set req = dbcurrent.OpenRecordset("reqblockum") If Not IsNull(DLookup("Portatil", "reqblockum", "Portatil = '" & Forms!Requisições!por825955 & "'" _ & " AND Data =#" & Forms!Requisições!Data & "#")) Then MsgBox ("O portátil já foi requisitado") Exit Sub ElseIf (prof825955.Visible = True) And (outros825955.Visible = False) Then If por825955.Value = "Portátil" Or prof825955.Value = "Professor(a)" Then mensagem = MsgBox("Introduza um requisitante/portátil", vbOKOnly, "Laptop Manager 1.0") Else req.AddNew req("Data").Value = Data.Value req("Portatil").Value = por825955.Value req("Professor").Value = prof825955.Value req.Update Set req = Nothing MsgBox ("Dados gravados") por825955.Value = "Portátil" prof825955.Value = "Professor(a)" outros825955.Value = "" prof825955.Visible = True outros825955.Visible = False End If ElseIf (prof825955.Visible = False) And (outros825955.Visible = True) Then If por825955.Value = "Projector" Or outros825955.Value = "" Then mensagem = MsgBox("Introduza um requisitante/portátil", vbOKOnly, "Laptop Manager 1.0") Else req.AddNew req("Data").Value = Data.Value req("Portatil").Value = por825955.Value req("Professor").Value = outros825955.Value req.Update Set req = Nothing MsgBox ("Dados gravados") por825955.Value = "Portátil" prof825955.Value = "Professor(a)" outros825955.Value = "" prof825955.Visible = True outros825955.Visible = False End If End If End Sub
jpaulino Posted May 11, 2009 at 04:07 PM Report #263038 Posted May 11, 2009 at 04:07 PM Qual é o formato de Forms!Requisições!Data ? É que no Access o formato é mm/dd/yyyy. Se o formato não estiver correcto usa a função Format() para corrigir.
rogi_cps Posted May 11, 2009 at 04:12 PM Report #263043 Posted May 11, 2009 at 04:12 PM Qual é o formato de Forms!Requisições!Data ? É que no Access o formato é mm/dd/yyyy. Se o formato não estiver correcto usa a função Format() para corrigir. ou então altere o formato da data do sistema para o mesmo que esta usando. Aqui no Brasil usamos dd/mm/aaaa, e os sistemas vem marcado para dd/mm/aa, sendo necessária a alteração. Vc pode até criar uma aplicação em VBa que, ao abrir o banco ele já faça a alteração.
rogi_cps Posted September 10, 2009 at 08:11 PM Report #286369 Posted September 10, 2009 at 08:11 PM Conseguiste resolver????
vasco16 Posted September 12, 2009 at 08:15 AM Author Report #286588 Posted September 12, 2009 at 08:15 AM Conseguiste resolver???? nem por isso :S
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now