Good day.
I am new to MS Access database and I am currently developing a DB with search function in a form for an inventory purpose, I have followed some VB codes from the web.
Here is my issue; when I try to search using the configured combo box in the form it gives me these sets of values, here is the screenie //oi57.tinypic.com/24fxwzk.jpg (just add the http: before the forward slashes as the site wont allow me to post images or links yet)
Row source for data: "-1";"Office 2010";0;"Office 2007";1;"Visio 2010";2;"Visio 2007";3;"Project 2010";4;"Project 2007"
and here is the VB code:
Can anyone tell me where did I go wrong? I just wanted to eliminate the numbers and replace them with the actual values as name. ex. "-1";"Office 2010" instead of (-1) doing the search, it should be the value "Office 2010"
Thanks in advance
I am new to MS Access database and I am currently developing a DB with search function in a form for an inventory purpose, I have followed some VB codes from the web.
Here is my issue; when I try to search using the configured combo box in the form it gives me these sets of values, here is the screenie //oi57.tinypic.com/24fxwzk.jpg (just add the http: before the forward slashes as the site wont allow me to post images or links yet)
Row source for data: "-1";"Office 2010";0;"Office 2007";1;"Visio 2010";2;"Visio 2007";3;"Project 2010";4;"Project 2007"
and here is the VB code:
Code:
If Not IsNull(Me.compName2) Then
strWhere = strWhere & "([Computer Name] Like ""*" & Me.compName2 & "*"") AND "
End If
If Not IsNull(Me.cUser2) Then
strWhere = strWhere & "([Current User] Like ""*" & Me.cUser2 & "*"") AND "
End If
If Me.cboSoftware2 = -1 Then
strWhere = strWhere & "([Office 2010] = True) AND "
End If
If Me.cboSoftware2 = 0 Then
strWhere = strWhere & "([Office 2007] = True) AND "
End If
If Me.cboSoftware2 = 1 Then
strWhere = strWhere & "([Visio 2010] = True) AND "
End If
If Me.cboSoftware2 = 2 Then
strWhere = strWhere & "([Visio 2007] = True) AND "
End If
If Me.cboSoftware2 = 3 Then
strWhere = strWhere & "([Project 2010] = True) AND "
End If
If Me.cboSoftware2 = 4 Then
strWhere = strWhere & "([Project 2007] = True) AND "
End If
Can anyone tell me where did I go wrong? I just wanted to eliminate the numbers and replace them with the actual values as name. ex. "-1";"Office 2010" instead of (-1) doing the search, it should be the value "Office 2010"
Thanks in advance
Last edited: