Boolean Searches? Possible?

Jun 21, 2005

I have a search tool, but right now it is 100% case sensitive in the sense that if i search for "test" and my entry is "Test" it will not return any results.

is there any way to setup so I could say search for "Test" and it would find "test" properly? Or even to the extreme where I searched for "Tes*" and it came back with the "test" entry.

Thanks,

View Replies


ADVERTISEMENT

Boolean Declaration

Nov 9, 2005

Hi,

In ADP project I want declare ckeckbox data:

dim strDec as String

strDec = 1 ' if True
strDec = 0 ' if False

How can I show all records:
strDec = ? ' Show all recrords (true and false)

?

View 2 Replies View Related

Please Look At This Boolean Vs String

Dec 2, 2005

I'm working on a software that was developed by someone who left the company. The problem is that the software works for all locations execpt one that is in austria, after debuging I found out that there is a statement in the code that uses boolean true or false, the only way it worked is when I put an if statement with false or true as string, ex: if doc = "true" then
buttom line has anyone faced this problem, I searched microsoft website and they said that some vb engines don't convert boolean to string. Please Please if someone has a clue try to help. Thanks.

View 4 Replies View Related

Boolean Value In Query

Nov 2, 2004

I am creating table in ms access using query. How to specify data type for a boolean fields ie YES/No or TRUE/FALSE?

with regards
shruthi

View 2 Replies View Related

Boolean Type Search

Oct 31, 2007

I need to create a user interface that will allow a boolean type search of a field. This would mean item1 AND item2 AND NOT item 3, item1 or item2, item 1 NOT item2, etc.

I've set up a combo box setup with the following script, but I can't figure out how to adjust it to allow the multiples.

Please advise if I should adjust this or try a differenmt interface format for my users.

__________________________________________________ ________

Option Compare Database 'Use database order for string comparisons
Option Explicit

Private Function AfterCombo(WhichLine As Integer)
Dim CBox As Control, TBox As Control, AndBox As Control, TBoxA As Control
Set CBox = Me("Combo" & WhichLine)
Set TBox = Me("Value" & WhichLine)
Set AndBox = Me("And" & WhichLine)
Set TBoxA = Me("Value" & WhichLine & "A")
TBox = Null
TBoxA = Null
Select Case CBox
Case "All", "Blank", "Not Blank"
TBox.Visible = False
AndBox.Visible = False
TBoxA.Visible = False
Case "Like", "Equal", "Less Than", "Greater Than", "Not Like", "Not Equal", "Not Less Than", "Not Greater Than", "In List", "Not In List"
TBox.Visible = True
AndBox.Visible = False
TBoxA.Visible = False
Case "Between", "Not Between"
TBox.Visible = True
AndBox.Visible = True
TBoxA.Visible = True
End Select
End Function

Private Sub Cancel_Click()
DoCmd.Close
End Sub

Private Function FormatList(ByVal List As String, FieldType As Integer)
Dim NewList As String, CommaPos As Integer, Word As String
NewList = ""
Do While Len(List) > 0
CommaPos = InStr(List, ",")
If CommaPos = 0 Then
Word = Trim(List)
List = ""
Else
Word = Trim(Left(List, CommaPos - 1))
List = Trim(Mid(List, CommaPos + 1))
End If
If Word > "" Then
Select Case FieldType
Case DB_TEXT, DB_MEMO
If InStr(Word, """") > 0 Then
MsgBox "Don't type double-quotes in the list"
End
End If
Word = """" & Word & """"
Case DB_DATE
If InStr(Word, "#") > 0 Then
MsgBox "Don't type '#' in your dates"
End
End If
If Not IsDate(Word) Then
MsgBox "Your list contains non-date characters"
End
End If
Word = "#" & Word & "#"
Case Else
If Not IsNumeric(Word) Then
MsgBox "Your list contains non-numeric characters"
End
End If
End Select
NewList = NewList & "," & Word
End If
Loop
NewList = Mid(NewList, 2)
If NewList = "" Then
MsgBox "Your list needs a valid value"
End
End If
FormatList = NewList
End Function

Private Function MakeNull(C As Control)
If Len(Trim(C)) < 1 Then C = Null
End Function

Private Function MakeSQL(WhichLine As Integer, FieldName As String, FieldType As Integer) As Variant
Dim CBox As Variant, TBox As Variant, TBoxA As Variant
Dim Condition As Variant, Delim1 As String, Delim2 As String
CBox = Me("Combo" & WhichLine)
TBox = Me("Value" & WhichLine)
TBoxA = Me("Value" & WhichLine & "A")
Select Case CBox
Case "Like", "Equal", "Less Than", "Greater Than", "In", "Not Like", "Not Equal", "Not Less Than", "Not Greater Than", "Not In"
If IsNull(TBox) Then
MsgBox "You have left a parameter blank for field [" & FieldName & "]"
End
End If
Case "Between", "Not Between"
If IsNull(TBox) Or IsNull(TBoxA) Then
MsgBox "You have left a parameter blank for field [" & FieldName & "]"
End
End If
End Select
Select Case FieldType
Case DB_TEXT, DB_MEMO
Delim1 = """"
Delim2 = """"
If Not IsNull(TBox) Then TBox = QFix(TBox)
If Not IsNull(TBoxA) Then TBoxA = QFix(TBoxA)
Case DB_DATE
Delim1 = "#"
Delim2 = "#"
Case Else
Delim1 = ""
Delim2 = ""
End Select
Select Case CBox
Case "All"
Condition = Null
Case "Blank"
Condition = " Is Null"
Case "Not Blank"
Condition = " Is Not Null"
Case "Like"
Condition = " Like """ & TBox & """"
Case "Equal"
Condition = "=" & Delim1 & TBox & Delim2
Case "Less Than"
Condition = "<" & Delim1 & TBox & Delim2
Case "Greater Than"
Condition = ">" & Delim1 & TBox & Delim2
Case "Not Like"
Condition = " Not Like """ & TBox & """"
Case "Not Equal"
Condition = "<>" & Delim1 & TBox & Delim2
Case "Not Less Than"
Condition = ">=" & Delim1 & TBox & Delim2
Case "Not Greater Than"
Condition = "<=" & Delim1 & TBox & Delim2
Case "In List"
Condition = " In(" & FormatList(TBox, FieldType) & ")"
Case "Not In List"
Condition = " Not In(" & FormatList(TBox, FieldType) & ")"
Case "Between"
Condition = " Between " & Delim1 & TBox & Delim2 & " And " & Delim1 & TBoxA & Delim2
Case "Not Between"
Condition = " Not Between " & Delim1 & TBox & Delim2 & " And " & Delim1 & TBoxA & Delim2
End Select
MakeSQL = " And [" + FieldName + "]" + Condition
End Function

Private Sub OK_Click()
Dim Where As String
Const ObType = "Form"
Where = Where & MakeSQL(1, "Lyrics", 10)
Where = Where & MakeSQL(2, "TrackTitle", 10)

On Error GoTo OKCApplyError
If Where <> "" Then
Where = Mid(Where, 6)
DoCmd.OpenForm "MasterFormQuery", , , Where
Else
DoCmd.OpenForm "MasterFormQuery"
End If

OKCExit:
Exit Sub

OKCApplyError:
MsgBox "Error " & Err & " opening " & ObType & Chr$(13) & Chr$(10) & Error
Resume OKCExit

End Sub

Private Function QFix(ByVal X)
Dim P As Integer
If IsNull(X) Then
QFix = Null
Exit Function
End If
P = InStr(X, """")
Do While P > 0
X = Left$(X, P) & """" & Mid$(X, P + 1)
P = InStr(P + 2, X, """")
Loop
QFix = X
End Function

Private Sub exitselectform_Click()
On Error GoTo Err_exitselectform_Click


DoCmd.Close

Exit_exitselectform_Click:
Exit Sub

Err_exitselectform_Click:
MsgBox Err.Description
Resume Exit_exitselectform_Click

End Sub

View 9 Replies View Related

Queries :: Count Boolean By Row?

Feb 11, 2015

I have a table with seven Boolean fields: I need to count all the "trues" and return the row if the sum of the trues is greater than 3.how to do this.

View 2 Replies View Related

Combining Two Boolean Values?

Feb 11, 2012

I basically have two yes/no fields in an access table. I want field one to have the value yes if field two has value no, and the other way around.

I had a look at the Boolean operators, but im not sure where to go from there.

View 6 Replies View Related

How To Change To Boolean Data Type??

Apr 17, 2007

my teacher asked me to do Access homework to change data type from Text to Boolean. Data in "Owned car" field show as Y or N
17178
so I click on Design View and change datatype of this field from "Text" to "Yes/No" , than when I saved it show a message
17179
When I back to Datasheet view, all data in "Owned car" field change to be "No".

How can I change data type to be Boolean type without deleting my original data??? I want them to show the same as Y or N.

View 1 Replies View Related

Excluding Boolean Values From A Query

Mar 26, 2006

I have designed an invoice for a project that shows the amount of money needed to be paid, some of this has already been paid and some hasnt, how am i able to make it so that the values that have been paid and therefore have been checked are not include in the query. please help.

View 1 Replies View Related

Forms :: Boolean Checkbox Updates

Aug 4, 2013

I use a form for changing data. So when the user selects a record from a listbox I fill all fields of the form with the content relating to the selected line in the box. Nearly everything runs as wished.

All updates take place immediately but the Boolean field does not update or better it updates only after I move the cursor over it. Then it is correct. To make it clear, I do not need to press a button or click, I only move the cursor over the boolean checkbox.

I access VBA after clicking the line in the listbox and use the dlookup command to get the right values. Do I need something like a requery for a boolean field ?

View 3 Replies View Related

Modules & VBA :: How To Check If Boolean Variable Has Been Set

Nov 25, 2014

I have an Access 2010 db which has a load of global variables of type Boolean. The values are different for each machine the database is stored on, so I have a linked table to a separate Access mdb. On startup the database opens the linked table and assigns values to each variable.

However I need to differentiate between a valuable value of False and the variable having not been set. As boolean variables default to False, this is a problem. One option is to use data type Variant, but I know this is not efficient. I am considering using data type Byte instead of Boolean, with 1 as False and 2 as True.

View 7 Replies View Related

Searches

Aug 3, 2006

Hello,
I am creating a database for a client and have come across a small problem.
The basic background of the database is that it will be used to record and maipulate the results of observations that are conducted on members of teaching staff.
The client wants the ability to search for people that have not had an observation or have an outstanding observation. The observations are made on a termly basis (so there are three terms. 1, 2 and 3). When an observation is entered into the database, the term number is selected from a drop-down box.
I was woundering if anybody could help me with this as I am unter the impression that I am going to need to search for records that don't yet exist and I am unaware of how to do this in a database.

Any help will be much appreciated.

Many Thanks
Jason.

View 1 Replies View Related

Modules & VBA :: ApplyFilter With Boolean And String Data?

Nov 14, 2013

I have a form used to gather data around some supplier details, and we have a review check box with Boolean data. I'm trying to establish a filter button to filter un-checked boxes by specific suppliers from a drop-down list.

Although I've been able to run filters on suppliers and the review checks separately, together I get a "Type Mismatch" error. I thought it might be because of the Boolean data type, so I tried converting that to String but get the same issue.

So far what I've created is this:

Code:

Dim Chk1 As String
Chk1 = CStr([RevChk])
DoCmd.ApplyFilter , (" Chk1 = " & Chr(34) & 0 & Chr(34) & "") And (" [Supplier Name] = " & Chr(34) & txtSupplSearch & Chr(34) & "")

View 5 Replies View Related

Modules & VBA :: Public Boolean Variable Not Retaining Value

Oct 9, 2014

I have a backup subroutine which automatically triggers when the front-end is closed down (it just takes the back-end, makes a copy and compacts it).It's driven off a hidden form which I use to track who is connected to the BE at any given time. This form is opened as part of the AutoExec when the FE is opened and writes some basic user info to a table. When the form is closed, it updates the table and fires the backup process before quitting Access.

Part of that user tracking process checks to see if the same user is already connected - either elsewhere (i.e. on a different machine) or on the same machine (i.e. opening a second instance of the same FE) - which is undesirable (and, frankly, unlikely, but not impossible) A brief prompt appears to explain that they can only be connected once, at which point the application is quit (to enforce the rule) This also works fine.

I would add a public boolean variable, set it to True by default, then switch it to False if the same user is already logged on before quitting Access.Trouble is, the variable doesn't seem to be holding its value? Here is the Load event for the tracking form :

Code:
Private Sub Form_Load()

On Error GoTo ErrorHandler

Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String
Call InterfaceInitialise
blnPerformBackup = True

[code]...

For some reason, blnPerformBackup is False every time, even though I set it to True at the very start of the Load event (and it is a Public variable, defined in a separate module where I store all my Public constants and variables)

why it is not retaining its value from the Load event? I've checked and it does get set to True - and when I debug, it remains True - but at runtime it reverts back to False by the time it reaches the decision whether to backup or not?

View 9 Replies View Related

Speeding Up Searches

Mar 18, 2008

My Access DB has two Number fields and five Text fields (each having field size of 200). They contain text. The DB is organised year-wise. I have now crossed 15000 records. I find that the search is very slow. Search is done on all these text fields for each word typed. Some one suggested that I index the fields to speed up the search. When I tried to change the indexes to Yes, it didnt accept. Is there any other way to speed up search?

As an alternative, I created an append query to append records of the year I select in my form to another table so that I can search that table instead of the main table which contains all years records. But the append query is not appending records.

Any solution would be appreciated

View 1 Replies View Related

Item Searches

Jul 6, 2005

Hi everyone i was just wondering if anyone new how to do the following;

Data is entered into a text box named txtItemNo on exit a search is performed and the next textbox txtDescription displays the results.

There is a table with itemnumber and item description in it the results would be the description.

Any ideas? This is on a subform, dont think this amkes any difference though
Thanks in advance :)

View 2 Replies View Related

Combo Searches

May 25, 2006

Hi Guys,

I apoligies in adcance, this has probably been asked several times, but I tried searching the forum but couldn't find anything.

Just now I have a report running from a query were a name is input, the data is pulled out the table and is presented in the report.

I want to take out the potential for user error by having them select the name from the drop down and then running the search.

Years ago (I'm a little rusty) I managed to figure it out, but for the life of me I can't remember!

Any ideas?

Thanks

Steve

View 2 Replies View Related

Reports :: Sorting By Boolean Fields - Print All Different Combination

Feb 20, 2015

I have 3 fields Yes/No.

A B C

To be in order it is necessary that: A , B and C = Yes.

I would want to print all different combinations :

A = no et B et C = Yes
Then
A: Missing

Nom, prenom et adresse.
.....
.....

A = Yes, B=No and C = No
Then
B and C missing :

Nom, prenom et adresse.
......
.......
Etc.....

View 1 Replies View Related

Queries :: Select Query Return (text) Instead Of (Boolean Value)

Mar 26, 2015

how to do to return a text for each row (as field value) when a table field contains "1" as value ?

for example i have a table named "products" with a field/column called "promotion". Sometime a product is promotional, so in this case, the "promo" column holds "1" as value.

during a select on products table, how can i do to return "in promotion" (e.g.) if the column "promo" holds "1" for a product ?

View 1 Replies View Related

Queries :: Make Boolean (Yes / No) Field With SELECT INTO Sql Statement

Nov 28, 2013

I've been using a SELECT INTO statement to import data from a linked text file into a temporary table in Access. Something along the lines of :

SELECT [tblLink].[fld1] AS Field1,
[tblLink].[fld2] AS Field2,
[tblLink].[fld3] AS Field3
INTO [tblTemp]
FROM [tblLink]

(There's an INNER JOIN in there and some Nz / CLng functions but just want to keep it simple...)

Now - I've just realised I also need to create a couple of extra 'dummy' fields in my temporary table (for later on in the show) and I need them to be Yes/No format (will set them to False at first, then run some separate queries later to update them)

I tried this :

SELECT [tblLink].[fld1] AS Field1,
[tblLink].[fld2] AS Field2,
[tblLink].[fld3] AS Field3,
False AS Field4,
False AS Field5
INTO [tblTemp]
FROM [tblLink]

But this sets Field4 and Field5 as Number fields, with each record given a value of 0. What syntax is required in the SQL to make these fields Yes/No rather than Number?

View 4 Replies View Related

Mutlpe Searches For One Query?

May 11, 2005

Hi, in my attached databas ei have a form. If you look at the form you can see what it does. Where it pulls records for a student, i would like another button, that when pressed, will search all records for that student, with these records it will, then scan all the dates and the attended field. if the attended field for one date is all absent it will return the number 1, if theres two date where the attended field is all absent it will send back 2 and so on... the number will be outputed to a textbox

any thoughts
Thanks
Chris Lynch

View 2 Replies View Related

Wild Card Searches

Jun 22, 2005

Ive read loads of posts about Wildcard searches but am unable to find the answer to my problem. In one of my boxes on my search form the user places in the search criteria value, this can be from A1 - A16 all the way to G16. At the moment i'm using this as my seasrch query:

[Forms]![Search]![BoxNo]

So if I put in C1 then I get all the C1's, great. If I want to wildcard then I put in Like "*" & [Forms]![Search]![BoxNo] &"*", and again it works, this time it call enything with C1 in it i.e C13.

How can I adjust my query to do both, sometimes I only want the exact match othertimes I want to wildcard :confused:

View 4 Replies View Related

Newbie To Searches Through Forms

Oct 13, 2005

I have a form with a search text field, inwhich i want the user to type in a value to the search text and then I want a query which would search two tables and return which table the results in. i.e

Form:
Search Text Field ----> ABC12345

Table 1
Date
Container Number -----> No Record of that number

Table 2
Date
Container Number ------> Number Found

Result of Search

Date
Container Number ABC12345
Table 2

Can any one advise how to do this??

View 4 Replies View Related

2 Issues With Combo Box Searches...

Oct 10, 2006

Hello, here goes...


#1

I have a form with a combo box to be used for navigating to records (created using the wizard), based on a query with these fields:
1 - Last Name (Sorted Ascending)
2 - First name (Sorted Ascending)
3 - Company
4 - CustomerID (PK)

The combo box only partially works, it pulls up a list, but here is the problem:

If the name comes up 'Hartman, BillyBob', and there is only one Hartman, then all is well.

But if you have several Hartmans, say:

Hartman, Ace
Hartman, Bob
Hartman, Stan

and say you try to select Bob, it always goes to the first Hartman in the list (in this case Ace).

It is a pain in the ace, what am I doing wrong? Thanks for any help...

(I will ask #2 after this is resolved)

View 14 Replies View Related

Disable Wildcard Searches

Jan 30, 2008

Code:If Me.Search_Criteria_textbox = "*" ThenMsgBox "Please enter a full part number" & vbCrLf & "Wild cards are disabled", vbCriticalGoTo Exit_cmdSearch_ClickEnd If

This is the code I am using to stop * wildcard searches and it works fine. My problem is when users enter partial number enclosed like this *1345*.

Is there a way like above to stop them from entering that?

Thx!

View 2 Replies View Related

General :: Database Status Flags (Text / Boolean Or Number)

Mar 11, 2015

Is there a place within an Access database besides a table where you can store a flag (text or boolean or number) that persists after the database is closed and can be checked when the database is opened (using VBA)?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved