Bart g
Bart g

Reputation: 585

Querying a Yes/No field in an Access database from VB.NET

I am creating a registration form for employees and members. When creating an account for members and employees there must be a difference when creating the account because they will have different options. I check a box to differentiate employee from member and save it in the database. My question is how can I query the database to know if the box is checked or not. This is what I have but it does not work.

Dim login = Me.LibraryMembersTableAdapter1.IDPass(txtID.Text, txtPass.Text)

Dim EmployeeCheck = LibraryMembersTableAdapter1.EmployeeCheck(Employee:=True)

If login Is Nothing Then
    MsgBox("Input Error")
Else
    MsgBox("Welcome!")
End If

If EmployeeCheck = True Then
    frmEmployee.Show()
Else
    Member.Show()
End If

Upvotes: 0

Views: 2178

Answers (1)

Johnny Bones
Johnny Bones

Reputation: 8404

Yes/No boxes are bits. Their values are -1 and 0 respectively. See this question for more info, which is quite similar.

Upvotes: 3

Related Questions