Jump to content
Fórum Script Brasil
  • 0

Run-time Error '91':


malb
 Share

Question

Run-time error '91': Object variable or With block variable not set

Código:

Private Sub SlPreencheCombo()

Dim cSel As String

Dim SsPesquisa As Recordset

cSel = "SELECT DISTINCT * FROM USUARIO_SISTEMA " & _

"ORDER BY NOME_USUARIO"

'"WHERE NOT LOGON " & _

Set SsPesquisa = Restaurante_DB.OpenRecordset(cSel, dbOpenSnapshot)

If SsPesquisa.RecordCount > 0 Then

SsPesquisa.MoveFirst

Do While Not SsPesquisa.EOF

Combo_Usuario.AddItem SsPesquisa!NOME_USUARIO

SsPesquisa.MoveNext

Loop

Else

Combo_Usuario.Enabled = False

MsgBox "Não há nenhum usuário cadastrado no sistema! " & Chr(10) & _

"Favor entrar com a senha padrão do sistema.", _

vbInformation, "Atenção"

TxtSenha_GotFocus

End If

End Sub

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...