Function Switch

F

Frank Dulk

I am with a small problem, I am repairing a program in access and I needed
to only implement code in VB that don't know how to use VB well and I ask
for the vcs help.
the function Switch not this working this giving a mistake in time of
execution ' 5 ', I argue or procedure call invalidates.
somebody could give a glance in the code and to see if he/she has some
mistake.
I thank at once

Switch (TipoDoc = "AA")
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM [Documentos Arquivados] WHERE
[tip-docsigla]= '" & TipoDoc & "' AND [doc-arq-nro-documento] = '" &
NumDocumento & "'")
If rs.RecordCount = 0 Then
MsgBox "Documento não arquivado."
Else
Caixa = rs("caixanro-caixa")
pos = rs("doc-arq-posição-caixa")
Ano = rs("doc-arq-ano-documento")
Tipo = rs("tip-docsigla")
Msg = Tipo & " " & Format NumDocumento, "@@@/@@@@@@@-@") & " arquivado:
Caixa " & Caixa & "/" & Ano & " - Posição " & pos
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top