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.
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.
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
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
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.
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.
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 ?
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.
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.
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.
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?
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.
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 ?
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?
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
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:
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
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...
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?
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)?