Joining String And Printing External File
Apr 25, 2006
Hi Guys,
Been trying this one all day. I've tried playing with a few things from the forum and i'm nearly there. I just need a wee bit of expert help.
I have a form that displays a persons details and on it i have a command button, and all i want to do is to print a pdf file (or maybe jpg files) that are in a certain folder on a network.
To do this i must reference the employees name folder and then there name file.
This is what i have got so far:
Dim I As String
Dim S As String
Me.First_Name.SetFocus
I = Me.First_Name.Text
Me.Surname.SetFocus
S = Me.Surname.Text
Application.FollowHyperlink "F:Personnel Certs([I] & ""& [S])([I] & "" & [S]).pdf"
SendKeys "%(FP)"
SendKeys "~", True
************************************************** *
All is good until the Application line where i am trying to join the two text strings from the First_Name and Surname Textboxes.
The values for I and S are working.
The path to the folder is: G:Personnel Certs"persons name""persons name".pdf
The other method i could and may use is the command dialog which will give the user the choice of file to print but if i use this i want it to access the persons name folder anyway.
Many thanks in advance
View Replies
ADVERTISEMENT
Dec 8, 2004
Hi there,
In an access db, I want to add a field called 'FileName' and simply add a link to a file. In tabular view, would I simply put 'filesmynotes.txt' into the database? Also, when I asp this to a web page, should it (or can it) show as a hyperlink?
Thanks,
Greg
View 2 Replies
View Related
Jul 9, 2005
Is it possible to link external file again when database is ready and the source file has been moved to other location?
And going farther -> is it possible to create some kind of dialog wich prompts user to point the external file as linked?
Thanks!
View 5 Replies
View Related
Dec 23, 2006
We have saved image in the database as OLE Object. It is showing “Microsoft Photo Editor 3.0 Photo / Package” in the table. We want to save these pictures as external file in Jpeg format. Please help us to solve this problem.
Thanks in advance
View 1 Replies
View Related
Apr 30, 2013
Basically it's trying to take all the files in a given directory and add them into a existing database.
I have a database called Permit. the database has a field called "SEAL" and they will be creating an additional field "SCART" to hold the contents of the file that exist in the directory. Each image file, in directory, is named the same as a unique record in Permit.
example:
Permit-SC might have unique record 532442
An image file would be name 532442.
If the image file matches a record in Permit the image should be added to permit in a field called "SCART". At this point I'm not certain if I want a link or the actual image included in the record. since there's a possibility of including the permit file on the website it might be cleaner to have it included.
View 7 Replies
View Related
May 16, 2013
Here is the import statement I'm using:
DoCmd.TransferText acImportDelim, "IT315 Import Specification_txt", _
"IT315", "D:4533 Hires Rehire Status ChangeIT315.txt"
I can manually transfer the data ie thru File --> Get External Data etc but I can't seem to get the above statement to work --- with the same specification!!
The details are in the attached doc file.
View 6 Replies
View Related
Nov 6, 2013
I'm trying to find all the table names inside an external access file from a path.
I have a code for the user to select a file which return a patch to the file.
Then I need to find all the tables names from that file and append them to a list.
so I them can input them into a code and link the tables.
here is the code to get the file patch:
Code:
Function getFileName(path) As String
Dim f As Object
Dim varFile As Variant
Dim path
Set f = Application.FileDialog(3)
[Code] ......
View 8 Replies
View Related
Aug 13, 2014
I have a table that contains a primary key and I am trying to append records from a text file. When I go to append the records, it tell me that XXX amount of records were lost due to key violations. Shouldn't access be able to figure out how to create new ID's on newly appended data?
Access 2007.
View 3 Replies
View Related
Nov 24, 2014
I have some code which creates a record in an external csv file to provide information to upload a vehicle to the website. It works fine with the exception of creating duplicates when, for example an option to amend a record is given to the user before continuing to a new record. The option has to be in place in case there is an error in the specifics of what is important to be recorded in the database and under such circumstances the form code allows the user to tab through the form and correct any errors, but this creates duplicate entries in the csv file as the user has to pass through the 'SavePrintVehPurch_Exit' button a second time after corrections are made.
I am wondering if there is a way of altering the following code to effectively look look to see if the csv record exists and if so correct any changed field information rather than create a whole new record or create a new record where the record does not exist - The record in the csv file is determined by the 'Me.VP_VehRegMark.Value '.
Private Sub SavePrintVehPurch_Exit(Cancel As Integer)
Dim fileText As String
Dim fileName As String
Dim fileNumber As String
fileNumber = FreeFile
[Code] ....
I am wondering about introducing the something like the following ( but can't work out how to clarify comparison of the fields)
If Len(filename(fileText)) = ? Then
Do not change entry
Else
Overwrite the new detail
View 2 Replies
View Related
Sep 5, 2014
I have a table with an attachment field called email, where a .msg file is stored for each record. Looking for code to save this contents of this field in a folder in my drive.
View 1 Replies
View Related
Nov 24, 2014
I have an Access 2013 database which will generate a pdf report and attach it to an email using the code:
Code:
DoCmd.SendObject acSendReport, "Report Name", acFormatPDF, Nz(To email address, a), , , "Email Subject", "Email body", True
I would also like to automatically attach on the server to this email. Such a file stored such as servernamesharefilename.pdf. Is it possible to do this?
View 14 Replies
View Related
Aug 7, 2014
I'm building an application to record engineer input in Events (jobs) for an engineering company.
My main tables are Products, Builds and Events, together with fifty or so reference and ancillary tables which aren't really relevant to this particular head-scratcher.
A Build is derived from a Product and an Event is applied to a Build. An Event includes a sale, a service, a warranty repair and so on. Over time, multiple Events will be logged against a Build.
I have a searchable Events form (Search_Events), containing a subform (Search_Events_sub) whose contents dynamically change to reflect data entered in a variety of unbound fields in the main Events search form. Needless to say, the glue that holds things together is the Event_ID field.
On my Search_Events form, I'd like to place two buttons (Rpt_Event_client and Rpt_Event_internal) which will allow the user to print either a client or an internal copy of the event in question. The reason I want to use separate buttons rather than one button for both copies is that it's quite likely that different engineers will work on different parts of an Event's build, test and sign off process, and will want to print off and annotate the internal report, whereas only the final report will be sent to the client. Also, there will be some slight differences between the visible fields on each report (time and materials logged etc).
So far, I've managed to get the Rpt_Event_internal button to open the relevant Event report in preview mode, using the following on the button's 'on click' event:
DoCmd.OpenReport "Rpt_Event_internal", acViewPreview, "", "[Event_ID]=[Forms]![Search_Events]![Sub].[Form]![s_Event_ID]", acWindowNormal, ""
(In the subform, Event_ID is referenced as s_Event_ID because I'm using an nZ function in most of the search fields so that the results filter dynamically)
So far, so good: this works fine. However, from a usability perspective, and based on the fact that this will be the most-used feature, I'd really like to be able to have the button do the following:
- print the relevant report, based on Event_ID as above to a PDF file
- synthesise the filename of the report along the lines of "Event_" & [Event_ID] & "_Client_Copy_" & [Date()] & ".pdf"
- and to then have the standard 'save as' Windows location browser/file explorer dialogue box appear so the user can choose where to save the file. I don't want the filepath to be hardwired, rather I need the users to be able to decide where to save the file.
I'm using Access 2013.
View 3 Replies
View Related
Mar 5, 2014
I'm importing a txt file using the following code.
Now my question is, how can I make visual basic ask me to select a file to get the path and put it in a string.
And use this string in the DoCmd.TransfetText
Code:
DoCmd.TransferText acImportDelim, "IN-specification", "tblimport", "C:usersKimdesktop extfile.txt"
View 1 Replies
View Related
Oct 14, 2013
I have a table has two fields: CompanyLocation , FileName
I have a form that uses and unbound field to create a file path string
="file:///s:/My Folders/" & [CompanyLocation] & "/" & [FileName]
In the form it looks like file:///s:/My Folders/My Company One/This Is My File.doc
I then set this to hyperlink in the form but when i click on it nothing happens.
When i copy the link it gives me and paste it into Windows Explorer it works fine.
View 7 Replies
View Related
Apr 25, 2007
Hi, I have a command button that opens a pdf file. However i will be distributing the database as a runtime package and need to account for people having different versions of adobe reader so need to search for the filepath string where Acord32.exe is found. This is the code I have but I am stuck! Ay help aprpeciated!
Private Sub Command4_Click()
Dim stAppName As String
Dim stPathName As String
Dim fs As Object
Set fs = Application.FileSearch
With fs
.LookIn = "C:Program Files"
.SearchSubFolders = True
.FileName = "AcroRd32.exe"
.Execute
????? stAppName = .FoundFiles
Set fs = Nothing
End With
'specify path name for version of adobe acrord32.exe
'stAppName = "C:Program FilesAdobeReader 8.0ReaderAcroRd32.exe "
stPathName = GetIniSetting("C:WINDOWSSSI_DL3_PROGRS.ini", "DIR", "REPORT_FILELOCATION") & "HOOF.pdf"
Shell stAppName & stPathName, vbMaximizedFocus
End Sub
View 1 Replies
View Related
Jan 2, 2007
I have a complex query that I am exporting to a tab delimited text file.
The query has three date fields, and a time field. The query export results in both the date and time portions of the value being shown instead of one or the other.
I have tried using the format function to force the dates to only show the date portion, and the time field to only show the time portion. So far, without luck.
I would greatly appreciate help from someone who can spot what I am doing wrong. The sql for my query is below.
SELECT tblSiteVisits.RunID AS TripID, Format([tblSampleRuns]![RunDate],"mm/dd/yyyy") AS [Trip Start Date], Format([tblSampleRuns]![RunDate],"mm/dd/yyyy") AS [Trip End Date], [RunName] & " " & [tblSampleRuns]![RunDate] AS [Trip Name], "LUMMI001" AS [Project ID], tblSites.SiteNumber AS [Station ID], STORET_SiteVisitNum.VisitNum AS [Station Visit Number], [tblSiteVisits]![SiteVisitID] & "-" & [tblParameters]![Matrix] AS [Activity ID], [tblParameters]![Matrix] AS Medium, Storet_ActivityCategories.Activity_Type AS [Activity Type], Storet_ActivityCategories.[Activity Category], tblSampleData.QCIndicator AS [QC Indicator], STORET_Replicate.RepNo AS [Replicate Number], Format([tblSampleRuns]![RunDate],"mm/dd/yyyy") AS [Activity Start Date], "" & Format([VisitTime],"hh:nn:ss") & "" AS [Activity Start Time], STORET_TimeZoneOutput.TimeDatum AS [Activity Start Time Zone], "" AS [Depth to Activity], "" AS [Depth to Activity Units], tblSiteVisits.SiteComments AS [Activity Comments], Storet_MethodsProcedures.ProcedureID, IIf([LabParam]=-1,"WSWB","") AS [Gear ID], Storet_Characteristics.CharacteristicName, IIf(IsNull([PracticalDetectionLimit]),Str([Value]),IIf([Value]<[PracticalDetectionLimit],"Present < QL",Str([Value]))) AS [Result Value], tblUnits.UnitName AS [Result Value Units], Storet_Fractions.Fraction, "" AS [Result Comment], "" AS Personnel, IIf([tblParameters]![LabParam]=-1,[LabID],"") AS [Laboratory ID], Storet_MethodsProcedures.ProcedureID AS [Field/Lab Procedure], Storet_MethodsProcedures.SourceAcronym AS [Field/Lab Procedure Source], "" AS [Analysis Date], "" AS [Analysis Time], "" AS [Analysis Time Zone], "" AS [Lab Sample Prep Procedure], "" AS [Lab Sample Prep Procedure Source], tblSampleData.PracticalDetectionLimit AS [Detection Limit], tblSampleData.UnitID AS [Detection Limit Unit], "F" AS [Result Status], tblStatisticTypes.StatisticType AS [Statistic Type], IIf(IsNull([tblSampleData]![StatisticTypeID]),"Actual",[ValueType]) AS [Value Type]
FROM ((Storet_StaticFields RIGHT JOIN tblSites ON Storet_StaticFields.StaticFieldID = tblSites.StaticFieldID) RIGHT JOIN ((tblRuns RIGHT JOIN (tblSampleRuns LEFT JOIN STORET_TimeZoneOutput ON (tblSampleRuns.RunDate = STORET_TimeZoneOutput.RunDate) AND (tblSampleRuns.RunID = STORET_TimeZoneOutput.RunID)) ON tblRuns.RunTypeID = tblSampleRuns.RunTypeID) RIGHT JOIN (tblSiteVisits LEFT JOIN STORET_SiteVisitNum ON tblSiteVisits.SiteVisitID = STORET_SiteVisitNum.SiteVisitID) ON tblSampleRuns.RunID = tblSiteVisits.RunID) ON tblSites.SiteID = tblSiteVisits.SiteID) RIGHT JOIN ((Storet_Fractions RIGHT JOIN (Storet_Characteristics RIGHT JOIN tblParameters ON Storet_Characteristics.CharacteristicID = tblParameters.CharacteristicID) ON Storet_Fractions.FractionID = tblParameters.FractionID) RIGHT JOIN (Storet_MethodsProcedures RIGHT JOIN (Storet_ActivityCategories RIGHT JOIN (STORET_Replicate RIGHT JOIN (((tblSampleData LEFT JOIN tblStatisticTypes ON tblSampleData.StatisticTypeID = tblStatisticTypes.StatisticTypeID) INNER JOIN STORET_ActivityType ON tblSampleData.ResultID = STORET_ActivityType.ResultID) LEFT JOIN tblUnits ON tblSampleData.UnitID = tblUnits.UnitID) ON STORET_Replicate.ResultID = tblSampleData.ResultID) ON Storet_ActivityCategories.ID = tblSampleData.Activity_Category) ON Storet_MethodsProcedures.MethodID = tblSampleData.MethodID) ON tblParameters.ParameterID = tblSampleData.ParameterID) ON tblSiteVisits.SiteVisitID = tblSampleData.SiteVisitID
WHERE (((Storet_Characteristics.CharacteristicName) Is Not Null) AND ((IIf(IsNull([PracticalDetectionLimit]),Str([Value]),IIf([Value]<[PracticalDetectionLimit],"Present < QL",Str([Value])))) Is Not Null) AND ((tblSampleRuns.RunDate) Between [forms]![fmExportStoret]![StartExport] And [Forms]![fmExportStoret]![EndExport]) AND ((tblSampleData.SampleStrata)=1 Or (tblSampleData.SampleStrata)=2 Or (tblSampleData.SampleStrata)=3) AND ((tblSampleData.Exported_To_Storet)=[Forms]![fmExportStoret]![ExportType] Or (tblSampleData.Exported_To_Storet)=0));
and the code for the export is
Dim MYPATH As String
MYPATH = CurrentProject.Path & "EXPORTRESULTS" & Format(Date, "mmddyyyy") & ".txt"
DoCmd.TransferText acExportDelim, "STORETEXPORT", "STORET_MSRRESULTS_TABLE2", MYPATH, True
Thanks for taking the time to help :)
View 9 Replies
View Related
Mar 10, 2014
I have created a form to send emails with attachments. The attachment path is specified in an unbound field which I have called [ToAttach] Rather than typing in the path, I want to use the browse function. I have inserted a browse button and can browse for the required file using following, but can't figure out how to place the file name in the unbound field as a string.
Code:
Dim f As Object
Set f = Application.FileDialog(3)
f.AllowMultiSelect = False
f.Show
View 7 Replies
View Related
Feb 25, 2014
I was having trouble just setting each report with a particular print method - for some reason they just kept forgetting their individual settings and resorting to default on the machine.
This meant reports were printing on the wrong paper, or the wrong size paper, the wrong orientation and some times refusing to print if it couldn't find the paper (which is useful in runtime as it doesn't display error messages)
So I used Reports(rpt).printer properties (I forgot where I found this) to hard code the printer properties into each print command... this meant I had to use another function to insert the variables.
So all I had to do was say:
Code:
PrintMe("Invoice","InvoiceID",iID)
and a report would print to exactly how I wanted... but it's just too slow!
See attached for full code, I have a niggling feeling it may be the function: PrinterOK, to make sure the printer exists or not.
Code:
Function PrinterOK(sPrinterName As String) As Boolean
Dim MyPrinter As Printer
PrinterOK = False
For Each MyPrinter In Printers
If MyPrinter.DeviceName = sPrinterName Then
PrinterOK = True
Exit Function
End If
Next
End Function
I know it's the printing code, because if I stop the printing and just preview then it shows up almost instantly.
View 1 Replies
View Related
Jun 7, 2013
MS-Access VBA code to separate numbers and string from an alphanumeric string.
Example:
Source: 598790abcdef2T
Output Required: 598790
Source: 5789065432abcdefghijklT
Output Required: 5789065432
View 13 Replies
View Related
Mar 12, 2007
Hi all,
I was looking for some help. I am trying to setup a table with a field for web address. People are entering www.website.com etc however I need them to make sure it starts with http:// Is their any way I can put validation on the field to make sure that this is entered? Or maybe I could use an input mask?
Any suggestions would be gratefully recieved.
Andy.
View 3 Replies
View Related
Oct 25, 2006
Hi
I have an Access database that contains 2 tables. Both of these tables have the same structure and have the same field names. So:
Table 1 Fields :
Name
Address
Telephone
Fax
Table 2 Fields :
Name
Address
Telephone
Fax
Is there a way to write a query, that will show the results of both tables in one go. (None of the information in table 1 is duplicated in table 2 - I want to show all records from both tables in one new table). So, if both tables had 3 records each, the query would return:
Name - Address - Telephone - Fax
jon-uk-12345-54321 (from Table 1)
julie-uk-21451-41541 (from Table 1)
paul-ir-98545-11241 (from Table 1)
pat-uk-99585-63362 (from Table 2)
phil-uk-99985-99631 (from Table 2)
ted-uk-44444-55555 (from Table 2)
These 2 tables need to be kept separate, so I can't copy and paste the records from Table 1 into the bottom of table 2.
The field names are the same in both tables.
Can this be done?
Many Thanks
View 1 Replies
View Related
Jan 2, 2007
Hi All!
I have two tables. Table Heffalump which has field "DealGroup" and other fields as well... and table 8-YTD Principal Investments whic has field "book" and other fields as well... I need to use BOOK and DEAL Group as a combination primary key to compare against table 8-YTD Principal Investments. If there is a new DEAL GROUP then append into table "8 - YTD Principal Investments"
THANKS IN ADVANCE,
B
View 2 Replies
View Related
Mar 31, 2008
Hi Guys,
I have a problem which I cannot figure out.
I have a table which has an ID field and also a field with data. The ID field is 'not' unique.
I need to join all of the data fields which have the same ID field into one field. So it would be ID; Data 1, Data 2...
Any ideas? I would appreciate any help you could offer!
View 7 Replies
View Related
Aug 23, 2005
Seems like a simple question but I am stuck.
I need to join two strings from different records in a table
table eg
ID Desc
1 blah blah
1 more blah
2 blahring
2 blah
3 and last one
I want to join all the "Desc" strings that have the same ID to get
1 blah blah more blah
2 blahring blah
3 and last one
Can anyone help?? :o
Thanks
Paul
View 1 Replies
View Related
Oct 4, 2005
I'm trying to create a Purchase Order Database that requires a monthly summary of all the purchase orders in that month.
Examples of the fields i'm using are: Date, Vendor, Description, Item Number, Unit Price, Quantity, Sub-total, Total, etc.
Each table is a single purchase order, and there are around 3 or so every month. What I am trying to do is create a query in which all related fields are joined, and can be viewed as a single field.
For example:
Field 1 is DATE for Purchase Order (PO) 1, 2, and 3.
What I want to do is join all entries in DATE from PO1, PO2, and PO3 in a single query.
I want it to look like:
[DATE]
PO1......
PO2......
PO3......
I've tried several approaches to this problem, but they all have the same end result. It creates a seperate field for each table:
[PO1-DATE][PO2-DATE][PO3-DATE]
Any suggestions?
View 2 Replies
View Related
Aug 23, 2006
I have two tables. One stores details of all money travelling from A to B, one from B to A.
I have created queries 'qry_A_to_B' and 'qry_B_to_A' to get each set of information.
Since there are User IDs in each table that don't appear in the other, I'm using the following two queries to return all the TO and FROM values. By using both LEFT joins, I appear to be getting all entries.
'A to B data
'------------
SELECT
[qry_A_to_B Yearly].ABUserID,
[qry_A to B Yearly].ABMonth_of_Year,
[qry_A to B Yearly].ABYearly_Sum,
[qry_A to B Yearly].ABMonthly_Sum,
[qry_A to B].ABMonth
FROM
[qry_A to B Yearly]
LEFT JOIN [qry_B to A]
ON [qry_A to B Yearly].[ABUserID] = [qry_B to A Yearly].BAUserID
GROUP BY
[qry_A to B Yearly].ABUserID,
[qry_A to B Yearly].ABMonth_of_Year,
[qry_A to B Yearly].ABYearly_Sum,
[qry_A to B Yearly].ABMonthly_Sum,
[qry_A to B].ABMonth;
'B to A data
'------------
SELECT
[qry_B to A Yearly].BAUserID,
[qry_B to A Yearly].BAMonth_of_Year,
[qry_B to A Yearly].BAYearly_Sum,
[qry_B to A Yearly].BAMonthly_Sum,
[qry_B to A].BAMonth
FROM
[qry_B to A Yearly]
LEFT JOIN [qry_A to B]
ON [qry_A to B Yearly].[ABUserID] = [qry_B to A Yearly].BAUserID
GROUP BY
[qry_B to A Yearly].BAUserID,
[qry_B to A Yearly].BAMonth_of_Year,
[qry_B to A Yearly].BAYearly_Sum,
[qry_B to A Yearly].BAMonthly_Sum,
[qry_B to A].BAMonth;
How can I join these two, to provide a list of ALL information, from all ten columns, regardless of whether or not someone has both a TO and FROM value? i.e.
If they only have a TO entry, I want to see it; the other five columns would be blank.
If they only have a FROM entry I want to see it; the other five columns would be blank.
If they have both, I want them to line up on one line.
However I try to phrase the query, I seem to miss at least some of the information from one or both tables.
View 9 Replies
View Related