How Do I Use A Form Field To Open A File On My PC ?

Jun 2, 2005

I am trying to write a little database to view my MP3 collection (as you do when youre bored...)

I have a field that shows the full path to my MP3's

e.g "D:My MP3'siTunes MusicBob DylanDesire3 Mozambique.mp3"

I want to be able to click on the file link to launch the file in my MP3 player - I have tried changing the field type to "hyperlink", but that still doesn't work...

Any help greatly appreciated.

View Replies


ADVERTISEMENT

Open A Word File From A Form

Jun 5, 2005

Hi all
I need to run a certain file from the form
I create a button as follows
Select in the categories "Applications" then select "Run Ms Word"
I have tested it and it open Word but not even a blank page
I then open the code as seen below and want to insert the filename but do not know where. Can someone please help me?

Private Sub Command35_Click()
On Error GoTo Err_Command35_Click

Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Visible = True

Exit_Command35_Click:
Exit Sub

Err_Command35_Click:
MsgBox Err.Description
Resume Exit_Command35_Click

End Sub

The file is - D:PanelbeatersPb Manual.doc

View 2 Replies View Related

Open PDF File From Access Form

Sep 8, 2012

I have a lot of pdf file that we save every day and name them like this 8012012,8022012, that are 2 digits day, 2 digits month and four digits of years no slashes. The fields are txt fields that we receive from banks. After processing their data, the upper management wants me to open those pdf files form access . I have created form named frmOpenPdf, placed text box named txtName and placed also command button named cmdOpen . I research code over internet and here is below, but it doesn't work;

Dim avCodeFile As CAcroAVDoc
Dim MYSRTING As String
MYSTRING = txtName.Value
Set Acroapp = CreateObject("AcroExch.App")
Acroapp.Show
Set avCodeFile = CreateObject("AcroExch.AVDoc") 'This is the code file
avCodeFile.Open "C:Documents and SettingsDesktopETFPdfFilesMYSTRING.pdf",

I would like to have like this : an user types 08012012 and the code execute to open file names 0802012 in command button .

View 1 Replies View Related

Open PDF File From Access Form

Feb 13, 2012

I have a form where I enter data about Cities (just an example). The user will be able to to pick a pdf file (for example history of the city) and add its location in the matching record. Then anyone reading the form will be able to open (from a simple command button) the proper file.

City File
London london.pdf
Athens athens.pdf

I need a browse button for user to select the proper file and a command button. And I think that the file should always be available in the same URL.

View 7 Replies View Related

Open Word File Off Access Form

Jul 9, 2012

I have fairly large Access 2003 tables and forms on my job. I am curious if I can open word document off the form by using command button. Very often I need to put info off the form to word and sent it via e-mail to clients so I every time I have to keep a lot open word documents at the same time on my computer 10 or more that is slow pc down. I would like to have like this : on specific form I have command button and when i need to work with word document , click that button that will open specific word doc and when I am done I think I need a second command button to safe and close word document and so that i can attach it to e-mail and sent it out. So every time I need to work with word doc, I can open it off the form and close it also when I am done with it so no word doc would be open unnecessarily.

View 8 Replies View Related

Open Saved File Based On Form Textboxes

Feb 1, 2006

Hello all,

Do you have a code that would open a saved file based on the contents of 2 textboxes on my form.

The saved files would be in:
C:Documents and Settings100310257Desktop

I have a button on the form, but need a code that would pull up the savedfile using the name in textbox1 and the name in textbox2, like this:
textbox1-textbox2. e.g. textbox1 = Novo Group. textbox2 = AA
There is a saved file in the path above, Novo Group-AA

Thanks for helping!

View 4 Replies View Related

Programming For File Open Dialog In Access Form

Oct 11, 2004

I want to retrieve some parameters from file, So for that i want to implement File Open Dialog
in One of the form. File Open Dialong is available in Micrososft Common Dialog controls.

When i choose Microsoft Common dialog control from extra toolbars, it gives me error saying that "You don't have licence for using Common Control ActiveX.

Any help appreciated.

View 1 Replies View Related

Modules & VBA :: Open Specific Powerpoint File That Matches A Selection On Access Form

May 27, 2015

We have an access database which has a form that has a list box that details particular records. See attach "list box".

What I would like to do is double click on the record and this would look in a powerpoint folder (see attach "path") and open the presentation if there is a match to the value in Listbox Column 5 i.e. Tool Number.

I can get it to open the presentation if I include the tool number in the path but I cannot seem to be able to get it to compare the values and only open if there is a match.

View 4 Replies View Related

Forms :: Open A Form For Saving Results Of Query To A Text File On Desktop

May 6, 2015

I have a BE database, that when opened, opens a form for saving the results of a query to a text file on the desktop. It works fine, if the full path is entered.

The problem is, I want this saved on any users' desktop. I did some digging and found the %userprofile% variable, which when used, gives me the error.

I understand this should work in both Windows XP and Windows 7, which are the environments the full DB will operate in. So far the "EXPORT" button on the form has the following for the code:

Code:
Private Sub BTN_Export_Click()
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", "C:UsersMark N. McAllisterDesktopPubComExp.txt"
End Sub

When I tried this:

Code:
Private Sub BTN_Export_Click()
Dim strPath As String
strPath ="%userprofile%desktopPubComExp.txt"
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", strPath
End Sub

the error occurs.

View 10 Replies View Related

Modules & VBA :: File Open Dialog Does Not Allow Selection Of All File Types

Oct 4, 2013

I recently upgraded a DB from 2003 to 2013 and ran into the following problem.

I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.

In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.

Here's my code and a screenshot is attached.

Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show

[Code] ....

View 3 Replies View Related

Backup Current Access File Using Vba While The File Is Open

Jul 11, 2007

I have a button in the form of the current access file. What I want to do is when the user click on the button,
triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?

I have tried two methods but failed:
1) Use copytofile method, but I get permission denied due to file open;
2) Use dbengine.compactdatabase method, but it also has problem if the file is open.

View 3 Replies View Related

Open Text File Using Only First 7 Characters Of File Name

Nov 7, 2013

I need to open and process the data from a text file on the network.

The first 7 characters of the file name will be the same every day.

The rest of the file name will change from day to day.

There will only be one file in the folder that has those first 7 characters.

There are a total of about 120 text files in the folder every day - give or take - including the one I need to open and read.

View 6 Replies View Related

Forms :: Open Blank Form Based On Value In Text Field In Main Form

Jun 6, 2013

I have one table containing name of restaurant with its address etc. Then i created another table to list out the restaurant workers names and details. Just as an example,

Table:Restaurant
Restaurant name
Address line 1
Address line 2
Restaurant #
Website

Table:StaffContact
Staff Role
Name
speciality
email
phone

I have the main form that has all the restaurant details only. And i have another form containing the Staff information. Please note the two table have a relation and it works well.

Now to make it user friendly(basically easier for the lazy ones), I dragged the staff contact form on to my main form and displayed it as a datasheet(basically a sub form).

Now, my boss does not want users to add/delete on this sub form(datasheet). So,he wants me to create buttons to open new record of staff for each restaurant(new form)

My issue is with opening a new record to enter a new person to the staff list and give them a role as well in form view.The new form has

So i ran a Macro, with open form with Where condition

Code:
[Staffcontact]![Rest Name]=[Forms]![MainForm]![RestaurantName]

But, it does not work .

View 2 Replies View Related

General :: Open Save File Dialog - Select File From Text Box And Save To Selected Location

Aug 8, 2013

I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !

View 1 Replies View Related

Forms :: Open Second Form On Related Field From First Form?

Aug 22, 2013

how to write code to open a second form on the click of a button on the first form and specifically to continue on the record set I am focusing on.

I have 2 tables. The first is tblAccount (fields: AccountID [the PK]; AccountHolder) and the 2nd is tblUser (fields: UserID [the PK]; UserName; AccountID). They are linked so that one account can have multiple users. Each has a respective form; frmAccount and frmUser.

My goal is that once the AccountHolder field has been populated in frmAccount I can click a button to open frmUser with the AccountID field already showing in the form header.

I have managed to do something similar by selecting from a combo box before but I am having trouble making this work after directly populating the AccountHolder field and using an open Form button.

View 2 Replies View Related

Open Form With Data In Field

Jul 4, 2006

I have tried searching, but have not foud anything that quite fits the bill for this.

I would like to add some code to my event procedure for opening my form so that when it opens a field has a value entered in it and then the record is saved.
My form name is frmCompanyClients based on tblCompanyClients and the field is ClientType (text box)

I don't want to use a default value as I want to change what goes into that field depending on user input on the Front Form.

I need to save the record as soon as that is done so that a Client_ID number is generated and my subforms can then be properly associated via the Client_ID field. I was having problems with unassociated records, and found out that it was because I was entering data into the subforms first and not any of the parent form's fields and so because no Client_ID was generated I was getting the lost records.

Thanks
Nicolas

View 4 Replies View Related

Use Hyperlink To Open Form Based On Value In The Field?

Jun 12, 2014

I have a continuous form that lists all unapproved invoices. I would like to have a hyperlink at the end of each row that says Review and will open another form that queries the details of the unapproved invoice based on the invoice number in the current row.

View 9 Replies View Related

How To Get Access To Open Up From A Form Filepath Within A Field

Jul 8, 2015

I am trying to get access to open up from a form a filepath within a field. I have managed to get a module for this to be able to open a default application. However I,m now not sure how to link this to the field. I've attached a link to the DB.

[URL] ....

View 1 Replies View Related

Query Using Field From Current Open Form Using VBA Function

Oct 23, 2005

I am trying to resolve an issue of being able to use a query from many different forms where the query is dependent on the date selected in the current open form. Right now it calls the function getDate() which works fine. Unfortunatly the function is called before the form is fully loaded and the control I want to pass has no value/doesn't exist yet and I get a
"Runtime error 13 Type-Mismatch"

Here is the function code:

Function getDate() As String

If fIsLoaded("F_SupplierData") Then
getDate = Form_F_SupplierData.txtDate
Else
getDate = "01/01/1901"
End If

End Function

Function fIsLoaded(ByVal strFormName As String) As Integer
'Returns a 0 if form is not open or a -1 if Open
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 Then
If Forms(strFormName).CurrentView <> 0 Then
fIsLoaded = True
End If
End If
End Function


Is there a way to detect the state of the text field itself (if it is open, closed, dirty)? Or if anyone has a better way to tie a query to multiple forms?

View 5 Replies View Related

Forms :: Open Form If Date Field Is Passed?

Apr 15, 2013

I have a form with numerous fields on it, with the one I'm concerned about being a date field.

I want a different form to open automatically if the above date field is in the past (this will act as a warning to the user).

I've created the warning form as a pop-up view but just want to know the best way to have it open automatically.

Can this be done via a macro in the OnOpen Property (or maybe OnLoad) or will this have to written in vba.

View 7 Replies View Related

Modules & VBA :: Subform DS Click Field To Open Tab On Another Form

Apr 19, 2015

How do I reference a subform DS field to open up a tabbed form on another subform.

Here's what I have.

field one on the Sub DS opens up tab one on another form, as does field two on DS open tab two on another form.

but..

how can I click on "any" field on the DS, run an IF statement, and it checks if that record on the Datasheet, contains information in regards to, IF field one OR field two contains any data, and opens the tabbed form respectively on the other form?

View 3 Replies View Related

Forms :: How To Open Form Depending On Field In Subform

Sep 22, 2013

I have a Table table_clients and a connected table (1-->many) table_invoices.

I have two forms:

form1(table_clients): all clients with subform1(table_invoices): all invoices for every client

the form2 and subform2 are the same, just objects are placed differently on page.

I want when I have opened a record on form1/subform1, to be able to click a button and open form2/subform2 filtered by the invoice_id and the client_id.

View 13 Replies View Related

Forms :: Date Field Populate Automatically When Open Form

Aug 5, 2013

Is there a way to have a date field populate automatically when a form opens but be able to change that date if need be?

View 4 Replies View Related

Modules & VBA :: Open Form To Record With Latest Date In A Field

May 12, 2014

I am trying to make an on-click event that would open a form showing the last inspection done on a site.

Unfortunately, I cannot even first create a dlookup function to use, so I haven't even attempted the rest!

The data needed to reference is in one table, and I just...can't... quite get it.

Here is my last attempt (which at this point probably isn't my best )

Code:
=DLookUp("InspectionID","tblInspections","SITEID = '" & [Forms]![frmFMHome]![txtSITEID] & "' AND InspectionDate = #" & DMax("InspectionDate","tblInspections","SITEID = '" & [Forms]![frmFMHome]![txtSITEID] & "'") & "#")

After breaking it apart I'm pretty sure the DMax function (and using date?) is the culprit, but I can't figure out why.

View 3 Replies View Related

Browse And Open Folder Based On Matching Form Field

Sep 18, 2012

My situation is that the access form field name is "Number" , there is a folder named "member" in

desktop C:UsersTomDesktop

For example If i press the command button (Field name "Number" is 123) in form , then automatic open named "123" folder inside named "member" folder

What is the Command button Code ?

View 4 Replies View Related

Open Any File

Jun 2, 2005

hi there,

I thought my problem would be a common one but after spending enough time on the net and all forums i couldn't find my answer... anyway... here is my problem. The database is about creating reference, the table contains multiple references, i create a folder where i'll put all the files to be attached

I wanna a create a link to a file... the thing are :
- i want to open any kind of file (or at least i specify in a table what kind of file to open (jpg, pdf, etc...)
- The name of the file is different for ever record...
Anyway i think it will be more clear with the code :


Private Sub File_Name_Label_DblClick(Cancel As Integer)
Dim rst As New ADODB.Recordset
Dim file As String
Dim fold As String
Dim i As Integer

'Open Table Folder
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.LockType = adLockPessimistic
rst.Open "SELECT * FROM Folders;"

fold = rst("Certificats")
rst.Close

rst.Open "SELECT * FROM FileType ORDER BY FileType.FileType DESC;"

'Find File

file = DocNo + rst("filetype")
If file <> "" Then GoTo OK
rst.MoveNext
OK:
'Open File
Application.FollowHyperlink file, , True
Bye:

'Close Table
rst.Close
Set rst = Nothing
End Sub

But there is an error (runtime error 490), any help would be appreciated

Thanks again ..

View 1 Replies View Related







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