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 Replies


ADVERTISEMENT

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 3 Replies View Related

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 :: 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

Modules & VBA :: Displaying Picture From Imagelist

Jul 8, 2014

I want to display a picture (or pictures) from Imagelist in the picturebox (KIBES_picture).But I am getting a type mismatch error in the last line. What am I doing wrong?

Code:
Public Sub load_picture()
Dim iml As ImageList
Set iml = New ImageList
iml.ListImages.Add , , LoadPicture("K:Kapa-Planung ElektrikKibes_DatabaseAufbausystemme2_Innenbeleuchtung.00000-0002_Treppebeleuchtung_ueber_2 Schalters_087A00ekran_edycja.jpg")
[Forms]![Search]![KIBES_picture].Picture = iml.ListImages(1)

Besides, when I have Listimage(0) I am getting an other error: Index out of bounds. Strange, because the index should start from zero?

View 1 Replies View Related

Modules & VBA :: Embedding A Picture Into Email

Sep 24, 2014

I am trying to embed a picture in an email, code below:

Code:
Dim MyOutlook As Object
Dim MyMail As Object
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)

[Code] ....

View 3 Replies View Related

Modules & VBA :: Insert Picture In SQL Using Button

Oct 4, 2014

I use the botton code for save image in SQL

Dim fDialog As Object
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Set Cn = New ADODB.Connection
Cn.Open "Provider=SQLOLEDB;data Source=.;" & _
[Code] ....

But I have a problem when my database more than 2000 record. I think my problem in

rs.Open "Select * from Table_2", Cn, adOpenKeyset, adLockOptimistic

because select all record in Table_2

I decided to use bottom code

strSQL = "INSERT INTO Table_2(image_v,sabt,filetype_v,imageid) Values (mstream.Read,'" & [kodimage] & "','" & [file_type] & "','" & Me.Text8 & "');"
Cnxn.Execute strSQL

But I get an error with mstream.Read!!!!

View 3 Replies View Related

Modules & VBA :: Saving Picture To Specific Folder With Customized Name?

Feb 8, 2014

I have below module to save picture under named folder:

Code:
Option Compare Database
Public Enum acFileType
acPicture = 1
acFiles = 2
End Enum

[Code] ....

But how to save the picture with customized name, say "Materials 0001.Jpg"

View 7 Replies View Related

Modules & VBA :: Export Picture Attachment To Word Document

Dec 17, 2013

I am trying to export an attachment item (Picture .jpg) to a word document. I have been exporting text to a word document successfully with below syntax "

With rst
strLandSalesID = Nz(.Fields("LandSalesID"))
strPhotograph = Nz(.Fields("Attachments"))

However, attachment do not work.

View 3 Replies View Related

Modules & VBA :: Unable To Display Linked Picture - Too Large

Jul 17, 2015

A newbie problem: Trying too display a linked picture using Win 8.1, get error picture too large. OK in Win 7.

Am using Access 2002 (10.6501.6567) SP3. The instruction flagged is:

Me![ImageFrame].Picture = Me![ImagePath]

View 1 Replies View Related

Modules & VBA :: Shell Picture Viewer Command Opens Minimized?

Aug 13, 2015

I'm having trouble with a shell() command in my vba.

I'm trying to call up the picture viewer showing the file of the photo I clicked on in a form. Everything is happening as expected - the file opens in Windows Photo Viewer, but it is minimized.

I can open a picture fine from Windows Explorer, but something about my shell command is forcing a minimize.

Here is my code:

Code:
Dim sFile As String
PicFile = "C:Pics" & Me!PicName & ".jpg"
Shell "RunDLL32.exe C:WindowsSystem32Shimgvw.dll,ImageView_Fullscreen " & PicFile

I would have assumed ImageView_Fullscreen would do what I want!

View 4 Replies View Related

Modules & VBA :: Search For All Picture Files In Documents And Copy To A Folder On Desktop

Mar 28, 2014

I've been trying to search for all picture files in my documents and copy them to a folder on the desktop. I found this and it work great for searching however I'm having trouble getting the copy to work. [URL] ....

Code:
Dim colFiles As New Collection
RecursiveDir colFiles, "C:Photos", "*.jpg", True
Dim vFile As Variant
For Each vFile In colFiles
Debug.Print vFile
Next vFile

Code:

I replaced the debug.print vfile with my copy function. I've tried copyfile but it needs to specify the destination with the file name. I tried using the FSO filecopy method and can't get it to work (keep getting a compile error "Expected =") I feel the hard part is done and this part should be simple.

View 3 Replies View Related

Modules & VBA :: Changing Image Path - Set Picture Property Of Image

Dec 4, 2014

I have a form that I would like to update a picture on using VBA. The source of the picture path is in part a query that is not bound to the form. So far I have the following code that is pretty much working, but with a couple flaws.

Code:
Private Sub Form_Current()
LoadDefaultPicture
End Sub
Sub LoadDefaultPicture()
Dim db As DAO.Database

[Code] ....

This is working. However, when I change the record the picture flashes the current picture once and then loads the new picture. It is like it reloads the current picture then loads the new one. I'm hoping there is a way to get rid of the flash.

Also, the code fails here:
strDefaultPictureName = rs.Fields("AttachmentName")

When the query does not return a record. I can definitely fix this by adding an if statement to check for a record, but I'm kind of perplexed at why it is failing at that line. I would expect it to assign an empty string to that variable name and then fail on the next command where I try and set the ".Picture" property of the image.

View 8 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







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