Modules & VBA :: Wildcard In URL / Before And After

Feb 21, 2014

I'm trying to add a spreadsheet from a folder using wildcards by just looking for a number in the file name.

strPath = "C:Training"
strFile = strPath & "*" + "(ZZ131008)" + "*.xls"
DoCmd.TransferSpreadsheet acImport, , "Training1", strFile, , ""

I get a response saying it cannot find the file and it shows the * in the path it cannot find. How can I make it find the right file?There are more files in the folder and the (ZZ131008) defines that course, I'd like to reuse the code for the other courses too.

View Replies


ADVERTISEMENT

Modules & VBA :: Exclude String From Wildcard

Oct 17, 2013

I have:

Code: Kill "Z:Client_Reports" & [websiteID] & "" & LEFT([Forms]![frm x main]![month name], 3) & "*"

This has been working fine - all the files that meet that criteria are deleted, but now I need the option to exclude a particular file from those to be deleted: the particular file would be identified by having some specific text in its filename. So for example I need to be able to delete all files meeting the criteria EXCEPT any files that have the string "summary" as part of the filename.

View 5 Replies View Related

Modules & VBA :: ImageFrame To Open As A Picture Using Wildcard

Jan 29, 2014

I want to my ImageFrame to open as a picture. My problem is that my picture could be either a .jpg or a .png (or whatever). The code below works if I hard code profile_pic.png or profile_pic.jpg. Is there a way to use the wildcard here? (Its not working as written now)

Code:

Dim vFolderPath As String, strFile As String, dirFile As String
vFolderPath = DLookup("FolderName", "tblCodes-FolderControl", "FolderKey = '" & "Profile" & "'")
dirFile = Dir(vFolderPath & ctrl_people_id & " *", vbDirectory)
strFile = "profile_pic." + "*"

[code]...

View 8 Replies View Related

Modules & VBA :: DLookup - Wildcard Search On Both Sides?

May 27, 2015

When trying to match people's names - sometimes with a middle initial, sometimes without - I'd like to try to wildcard each side of it.

So this

Code:

varProblem = DLookup("EMAIL_ADDRESS", "tblUsers", "EMPLOYEE_NAME Like '" & varString & "*'")

but also something like this.

Code:

varProblem = DLookup("EMAIL_ADDRESS", "tblUsers", "EMPLOYEE_NAME* Like '" & varString & "'")

View 8 Replies View Related

Modules & VBA :: Edit A String Or Use Wildcard In Search Function

Jul 18, 2013

Access 2007

I can't figure out how to replace a period that is in the middle of a string and end up with 10 digits. For example 55.5555 would be 5500005555. I can use replace() but the tricky part is I have to end up with 10 digits.

Ultimately what I'm trying to do is - when a user enters 55.5555, 555.5, 5.5 or any variation they will be able to find the corresponding record. So a wildcard for the search or the replacement of the "." with enough zeros for 10 digits.

Here is what I'm using now - i making them enter the full 10 digit number but would like to give them the ability to use the period in place of the zeros.

Function Search()
Dim lssql As String
Dim lsSn As Recordset
Dim db As Database
Dim lsMessage As String
Dim sMsg As String
Dim vRetVal As Variant
Set db = CurrentDb()

[Code] .....

View 2 Replies View Related

Modules & VBA :: Search Form Will Not Return Exact With Wildcard SQL

Jul 4, 2014

I did export the table data into a tabbed delimited format and will include that at the end. If you want to reproduce my bug copy that data in a txt file and import that into the table tblMain. Make a search form and a sub form. the sub form is linked to the table and the main form is unbound with two search buttons.

Problem Statement:The code works fine. I did find a bug that seems to arise with the wild cards when the entire field values are entered. You can replicate the bug by testing the search criteria listed below.

This is a brief example of the bug. A detailed description is near the code below.

If my name is "Devtycoon" and I search "Dev" the SQL statement will build "*Dev*" and it will pull up my name, "Devtycoon". On the contrary if I search "Tycoon" the SQL statement will build "*tycoon*" and it will pull up my name, "Devtycoon". If i search "DevTycoon" the sql statement will build "*Devtycoon*" and no results will be returned. That is buggy because the name is in the database but no wildcards would be needed.

Table structure:

tblMain
ClientID
Surname [text]
Organization [text]
ProgramTitle [text]
City [text]
State[text]
Zip4 [text]
Telephone [text]

Form1 contains the controls for search criteria. Three text box controls are used to filter a sub form control called "DS". The sub form is called sFrmMain and is a datasheet that shows results of the search. there is a button that runs the code and another button that clears search criteria and shows all records. Both button's code set the sub form's record source using an SQL string built using a function that returns a segment of the overall search string using the contents of each control that then is concatenated into a SQL statement used to set the record source.

There is a function for the following components of the SQL statement

SELECT / FROM
WHERE
controlA = me.txtSurname
controlB = me.txtOrganization
controlC = me.txtProgramTitle
This is how you can replicate the bug.

I tested two additional surnames organizations and program titles as follows:

Try example (1). you will get both the 4's and the 14's records returned.

If you type in letter for letter of the second record (the one with the 14's) no records populate. It is like the wild card does not like it if you type in the entire field value. Uncle Gizmo's and Allen Brown's method do the same thing were no records populate if the 14's entire surname organization and program title are entered into the text controls. Can you reproduce this error? Other than that I think either method is bulletproof.

Example criteria

1) put the following criteria in each control then hit the search button

4 surname
4 organization
4 program title
[two records returned]

2) put the following criteria in each control then hit the search button

[no records returned]
14 surname 14
14 organization 14
14 program title 14

Code behind search form:

Code:
Option Compare Database
Option Explicit
Private Sub cmdShowallRecords_Click()
Dim strSQL0 As String
Me.txtOrganization = ""
Me.txtProgramTitle = ""
Me.txtSurName = ""
strSQL0 = fSQL_SelectFrom & fWhere & fSurName & fOrganization & fProgramTitle
Me.DS.Form.RecordSource = Left(strSQL0, Len(strSQL0) - 5) & ")"

[code]....

View 12 Replies View Related

Modules & VBA :: Wildcard Search Of Combobox - Lookup Values In Table Column

Nov 19, 2014

I have a form which has a combobox called Task_Ref which looks up values in a table column.

I would like to be able to set the tickbox value of tickbox called P1 to True if the combobox contains the word "test", each entry on the combobox selection may vary such as:-

Test number 1
Yesterdays Test

As long as the word "Test" appears I would like the above to happen?

I was thinking of something along the lines of:-

If InStr(Task_Ref.Value, "Test") > 0 Then
P1.Value = True
Else
P1.Value = False
End If
End Sub

But this hasn't worked

View 4 Replies View Related

How To Use Wildcard?

May 15, 2006

i've try and no luck... using Like "* *"

i'm tryin to create one that if i search for like let say "brisbane" it would show the results of the complete spelling, but let say if i was to just type "b" or "bris" it would show u a list of "B" towns or matching words of "bris".

any assit would be great

View 1 Replies View Related

Pop-Up WildCard

Jan 31, 2005

I have a field in a table that has the following data in it:

W-01-2005
W-02-2005
W-03-2005
W-04-2005
etc..

I created a query against this table and put a pop-up on this field so they can enter the search criteria needed, or leave blank for all.

I'd like to modify this pop-up code to ignore the W- and -2005. When the pop-up appears and asks them what week they want, I'd like for them just to enter 01 or 02 or 03 etc... not W-01, W-02 etc..

This is the code I have currently in this field.

Code: Like [Enter Two Digit Week] & "*"

Thanks, Leap!

View 6 Replies View Related

Wildcard Using Mid Statement

Jul 4, 2005

Can anyone say what the syntax would be for the "incorrect" statement below?

Like *Mid([checking]![COMPANY NAME],1,InStr([checking]![COMPANY NAME]," "))*

As the statement above doesnt work, just returns errors.

Thanks in advance

View 1 Replies View Related

Wildcard Entry

Aug 17, 2005

Hi,

Im having a little problem with the following code in one of my queries

Expr1: IIf(IsNull([Forms]![editLookForm]![Company_Name]),True,[Company Name]=[Forms]![editLookForm]![Company_Name])

What this does is, it take an typed entry from the form (editlookform) and seaches for that entry in the query

i want to add wildcard entrys to this so that the person operating doesnt have to know the complete company name - i just dont know where to put them

Help please

View 2 Replies View Related

Wildcard Queries

Aug 17, 2005

I am running a query that links to a "wildcard" form so that the user can basically run a query filtered on any field they want.

For some reason when I try to use wildcards along with Criteria in my query the query will not return any results. I know the link to the textbox is right because if I take out the wildcard and put an exact word from the table I get a result.

I have tried using many different combinations inclusive of the following:

Like [Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]
Like "[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]"
"[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]"
[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]

Any help would be appreciated, as always thank you ahead of time.

View 14 Replies View Related

Using Wildcard Characters

Oct 6, 2005

I have several queries looking up products from a table. I use a simple form to access the query and in the criteria of the field I use [Forms]![EnterCroft]![ProductName] to filter by name. (EnterCroft is the name of the form).

It works fine but doesn't like the asterisk (*) for all products.

I also want to use wildcard before and after key words in the product names, eg *cup* for anything with CUP in it's name.

How can I do this?

Thank you very much.

View 2 Replies View Related

Problem With WildCard

Dec 13, 2005

ok in access 2003 i have tried everything to get the Like "*oak*" to work but to all fail it replaces "Like" with "ALike" i have tried to find some info on this but have not it seams like something easy i wanted to do.

SELECT MainData.ModelName
FROM MainData
WHERE (((MainData.ModelName) ALike "*oak*"));

some reason it wont find all data with "oak" in it just returns empty

this is like query 101 but for some reason it has stumped me, along with one other problem but i am still researching that one.

View 6 Replies View Related

Wildcard Problems.

Dec 14, 2005

This is making me mad now :mad: i want a query to search for what a user inputs into the query. but for example if i seach in a field wheres there is one or more words in it. eg. I want to search my table for a address (60 donnington road etc) so in the user input box i type "donnington" but i get no results even though it should find "60 Donnington Road"

code i used. [Please enter address] now where does the wild card go?!?!

hope that makes sense :cool:
thanks

View 3 Replies View Related

Wildcard For One OR More Digits?

Mar 14, 2007

Hello, I'm trying to use wildcards to filter for records that contain a date somewhere within the string.

I'm using Like "*#.##.##*" which works for dates that have a day of the months >10, but what about those under?

Well, Like "*#.#.##*" only works for those with the day of month <10. Is there a wildcard character for "one or more digits"?

Also, the above example excludes Oct. - Dec. for the same reason.

help!

Thanks,
Gifford

View 4 Replies View Related

Wildcard Characters

Feb 24, 2006

Hey everyone, I've been busy creating a switchboard based on database, and I came across this issue. When I put a search through records command button, it seems that I can't use the wildcard characters, such as *,%,_ in order to find multiple records matching my criteria.

Am I supposed to "enable" them from somewhere or am I doing something wrong.

Any help?

Thanx in advance

View 1 Replies View Related

Wildcard Within A Combobox

Nov 20, 2013

I have a combobox with 2 columns where I manually set the following criteria:

"E";"English"
"F";"French"
"EF";"Bilingual"

In my employee table under the Languages field I have E,F or EF

I wanted to display in a sub-form a list of employees who speak a specific language but I can't use a wildcard in the combo-box properties. Basically when someone is looking for an English speaking employee they should get both E and EF employees not only E.

I tried doing "E*";"English" but it doesn't display anything.

View 10 Replies View Related

Wildcard On A Numeric Field

Jun 28, 2005

I have a query that prompts with a parameter box for the field Contributor_ID. Contributor_ID is a numeric field & Key and I use it to allow the user to print a report based on which Contributor_ID value the user enters. This works fine. However, I would like the user to have the option to enter * and then have the report include ALL the contributor IDs. I have done this before on a text field without a problem, however is this not possible on a numeric field as it is not working? I'm trying not to have another version for the ALL option.

If this is not possible, are there any alternatives?

View 2 Replies View Related

Update Query Using IIF And Wildcard

Feb 1, 2006

Hello,
I am not sure if this is possible, but I am running an update query to add text in a field if a certain criteria is met. However, if the field I am adding to already contains what I am trying to add, i don't want it to add it again. Everything works fine except the IIF statement in my update field. Here is what I have:


IIf(Temp_Vendor_Trips.[Reco Classification]="*" & "V3" & "*",Temp_Vendor_Trips.[Reco Classification],Temp_Vendor_Trips.[Reco Classification] & " " & "V3")


If the field contains the text V3, I want it to be left alone and continue to show what is already in the field, if not, i want it to add V3 to the end.

Thanks in advance for the help!

View 1 Replies View Related

Upper Case Wildcard?

May 26, 2006

Just been searching around, found a few posts of uppercase questions, none that quite fit with mine, anyway,

Basically, the data I am working on produces names as such "JoeBloggs" "FredPerry"

Anyway, Im going to use a query to seperate these out into first name and last name, but, I can't seem to find a way to specify a capital letter as a wild card. So far:

CapPos: InStr(2,[calllogs]![CalledNumber],"A")

Then I am going to use the mid function to seperate the two, depending on the position of the first capital letter.

But I just need to replace "A" with something that will find any capital letter.

Cheers

View 10 Replies View Related

SQL Wildcard And Is Null Statements

Jul 10, 2006

I have a SQL that enables the user to search the form from different combo boxes to narrow down the data. I can get this to work but it only finds the fields that exactly match their input data. I want them to be able to type something in the combo box and then it pull up anything with that value in that field, whether it is 1839B or B1839 it should find both if I type in 1839

Here is my sql statements

SELECT DISTINCT [WeldingSpecification].[Spec], [WeldingSpecification].[Steel Type], [WeldingSpecification].[Group11], [WeldingSpecification].[Group143], [WeldingSpecification].[Substitute1]
FROM WeldingSpecification
WHERE ((([spec] & "") Like IIf([Forms]![frmSearchCriteriaMain]![spec] Is Null,"*", [Forms]![frmSearchCriteriaMain]![Spec] & "*"))
And (([SteelType] & "") Like IIf([Forms]![frmSearchCriteriaMain]![SteelType] Is Null,"*",[Forms]![frmSearchCriteriaMain]![SteelType] & "*"))
And (([Group11] & "") Like IIf([Forms]![frmSearchCriteriaMain]![Group11] Is Null,"*",[Forms]![frmSearchCriteriaMain]![Group11] & "*"))
And (([Group143] & "") Like IIf([Forms]![frmSearchCriteriaMain]![Group143] Is Null,"*",[Forms]![frmSearchCriteriaMain]![Group143] & "*"))
And (([Substitute1] & "")([spec] Like "*" & Forms![frmSearchCriteriaMain]!Spec & "*" & "") Like IIf([Forms]![frmSearchCriteriaMain]![Substitute1] Is Null,"*",[Forms]![frmSearchCriteriaMain]![Substitute1] & "*"))

Any help is appreciated, please ask if you do not understand fully

Riley

View 12 Replies View Related

Using Wildcard In Switch Function

Jan 26, 2007

I am trying to use a Switch expression as a column heading in a crosstab query to generate statistics for how much work is done per client (Requester). Each requester is referred to by acronym, so it may look like "DOD/OUSD/FTT/ATA/B", but I want that column to include everything that starts with DOD, instead of listing each instance separately. This is my expression so far:

Expr1: Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP")

When I run the query, the column "ATAP" shows up perfectly with all the correct info, but it's as if I never entered "DOD*". Nothing appears, and since I didn't add anything in the Switch function for what to do with other requesters, the second column shows up as <>.

Do wildcard *'s not work in Switch functions? I don't get any errors, but this is definitely not the information I'm looking for.

Is there any other way to include all Requesters that start with DOD in one column?

This is my SQl if that's helpful:
TRANSFORM Sum([Q and D Database].[Word Count]) AS [SumOfWord Count]
SELECT [Q and D Database].[Source/Target]
FROM [Q and D Database]
WHERE ((([Q and D Database].[Out Date]) Between #1/1/2006# And #12/31/2006#))
GROUP BY [Q and D Database].[Source/Target]
ORDER BY [Q and D Database].[Source/Target], Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP")
PIVOT Switch([Requester]="DOD*","DOD",[Requester]="DS/ATA","ATAP");

Thanks!!!

View 2 Replies View Related

Working With Wildcard Char

Mar 28, 2007

I know I have seen post close to this one but not hitting what I need.
I currently have a query that is structured as such...
Service: IIf([Serv] Like '*AA*',' Bas ','') & IIf([serv] Like '*AB*','Exp ','') & IIf([serv] Like '*CA*',' Dig ','') & IIf([serv] Like '*89*',' 384 ','') & IIf([serv] Like '*8H*',' 3M ','') & IIf([serv] Like '*?5*',' 5M ','') & IIf([serv] Like '*=W*',' 10M ','') & IIf([serv] Like '*<1*',' Tele ','')
Works great except for the last IIF stmt has now been changed to look for the code *6 - not wildcard6 -
How can I get Access to realize that I need it to look for
anything to the left or right but it must find the *6
This IIf([serv] Like '**6*',' Tele ','') wont work b/c I have other codes that end in 6.

I am at a loss - any help is appreciated.

View 2 Replies View Related

Quick Wildcard Question

Sep 6, 2007

In my query Im using the criteria

="cashpayer*"

to bring up any records in this field which start with cashpayer but its not working. Is my text correct?

Cheers
Phill

View 3 Replies View Related

Wildcard Search Funtionality

Jun 13, 2005

I am working on a form that will be used to search records in a table. I have created the query shown below:

SELECT tblSTC.STC, *
FROM tblSTC
WHERE (((tblSTC.STC) Like forms!frmsearch!txtsearch));

I want my user to be able to enter search criteria and allow the use of a wildcard. When i run the query no data is found??

Can anyone help, thanks.

View 3 Replies View Related







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