FILTRA DADOS
Como eu faço para filtrar dois tipos e informações diferentes ao mesmo tempo
* Eu tenha um secretaria que tal que contém varias salas
Ex. Secretaria Tal, orgao, sala
O meu código de filtrar e esse, mas so filtra um dado por vez
StrFiltro = TxtSecretaria.Text
FrmSistemaOp.CadSistema.RecordSource = ""
FrmSistemaOp.CadSistema.CommandType = adCmdText
FrmSistemaOp.CadSistema.RecordSource = _
" Select * From Cadastro Where " & _
"(Cadastro.Secretaria) = '" & StrFiltro & _
"' Order by Código"
FrmSistemaOp.CadSistema.Refresh
FrmSistemaOp.CadSistema.CommandType = adCmdTable
FrmSistemaOp.CadSistema.RecordSource = "Cadastro"
* Eu tenha um secretaria que tal que contém varias salas
Ex. Secretaria Tal, orgao, sala
O meu código de filtrar e esse, mas so filtra um dado por vez
StrFiltro = TxtSecretaria.Text
FrmSistemaOp.CadSistema.RecordSource = ""
FrmSistemaOp.CadSistema.CommandType = adCmdText
FrmSistemaOp.CadSistema.RecordSource = _
" Select * From Cadastro Where " & _
"(Cadastro.Secretaria) = '" & StrFiltro & _
"' Order by Código"
FrmSistemaOp.CadSistema.Refresh
FrmSistemaOp.CadSistema.CommandType = adCmdTable
FrmSistemaOp.CadSistema.RecordSource = "Cadastro"
select *from cadastro where campoNome=' " & TxtSecretaria.Text & " ' and campoidade=" & txtidade.text & ''
Obs: para campos tipo texto use ' " & txt.text & " '
para campos tipo numerico use " & txt.text & "
Boa sorte
Nilson Caires
Obs: para campos tipo texto use ' " & txt.text & " '
para campos tipo numerico use " & txt.text & "
Boa sorte
Nilson Caires
Tópico encerrado , respostas não são mais permitidas