Headache With Changing The Filename... ...
Oct 19, 2006
Hi all,
I got a headache to changing my form's filename... i am totally a newbie in Access while in the few months ago... so i just create all those form or table name's for the way i like. But now i had already know how important of management of the filename because when u r using the module to write the code u will be headache to look for the filename that u want in the code. So that is important to add 'tbl', 'frm', 'Qry' infront of the filename.
So do anyone have a good way to edit all the file name with all match to the other in the module with a quick way rather then one by one editing (really tired for one by one) Thanks!!!
View Replies
ADVERTISEMENT
Dec 4, 2007
Hi all,
ok i have a bit of a problem here and this is it.
I have set up a quesry based on 2 forms 1 orders and 2 order details.
i have the set a criteria on the report to print a order number
i have then set up a report based on the query.
Then i have created a command button on my form up untill here it is fine the problem is when i create the order and send it to print the criterai box pops up which is ok but because i am using a touch screen it will not be viable for the user to enter the number each time he prints i would want it to pick it up from the current order id.
Is there a way to do this as i am sure all invoice systems and everything should be working like this or is there a better way to do this or am i doing something wrong i have attached a screen shot of what si going on
Thanks
View 6 Replies
View Related
Jun 1, 2005
Hi guys
I'm having issues with getting UK dates to show in access.
I created a table and then undertook an insert with the following:
docmd.RunSQL "INSERT into tbl_test([dates]) VALUES (#01/06/2005#);"
Note that my machine is in UK local and the format of the field is short date. The date in access is 06/01/2005. ie 6th Jan , not 1st June as it should be
If I set up a query via the query wizard to look at this field then I see that the date is shown in US format.
I tried to use the following in the field section:
result: format(dates, "dd/mm/yyyy")
and the date still showed up at US ie 06/01/2005. argghhhh. (assume due to the fact that format returns a string and I'm looking at a date field)
Any ideas how to overcome?
View 3 Replies
View Related
Sep 28, 2006
I have a main form [mainform] with several subforms on it, two of which are on a tab.
On the second tab [page79] there is a subform [subformlist] which has like 25 checkboxes on it, any combonation of which can be picked by the user.
I need there to be at least one pick required of this subform, else the record won't show in a general query I have, since the table the subform is based on is linked to the record.
Is there anyway to make making a choice of one of at least one of these checkboxes checked a manditory thing before the user can close or move on to the next record?
I've tried making an "Other" box that on the Table has a default value of "True" which I thought would cause it to show in the query record...to no avail.
The only true way to make this work is to have it mandatory that the user pick from AT LEAST one, usually more before the record is complete.
Any help? Other than writing a MASSIVE If...Then statement...?
Or is there a way to make it so the choice isn't required for the record to show up in the query?
I'd post...but my db is too massive, even zipped.
:(
View 2 Replies
View Related
Jul 28, 2006
I am trying build what I thought was a super simple data base, but this is driving me crazy.
I have a group of building maintenance manuals (12) each of which is subdivided into sections. I have created a list of all the section headings and respective page numbers and have imported them into a table (tblMASTER ) with these fields:
MasterIndexpkf
SectionNumber (unique sequential number 1-311)
SectionName
PageNumber
I have a second table (tblCROSSREF) with these fields:
CrossRefIndexpkf
MasterIndexfkf
SectionNumber
SectionName
PageNumber
The two tables are linked in a one-to-many relationship on the respective MasterIndex fields.
I also have a query (qryMaster) which includes ALL the fields in tblMaster which serves as a lookup to the SectionName field in tblCROSSREF.
What I want to do is to select a section number in tblMaster and enter all the possible cross references in tblCROSSREF by selecting the available section names from qryMaster.
This seems to me to be sooo simple, but I am having a real headache!
My primary problem is that when I use the lookup function in the SectionName field (in tblCROSSREF) it returns not the Section Name, but the Primary Key Field number.
This thing is making me feel like the AFLAC duck. Can anyone give me a clue about where I have gone wrong?
Thanks,
Rick
View 4 Replies
View Related
Feb 7, 2006
I've been searching in vain for a solution to a relatively simple bit of mathematics that I’d like to Access to undertake.
It involves interpolating between data, as illustrated in the following example. Basically have several items, and let's say different "prices" dependent on the number of units purchased. The relationship between the “prices” is not a straightforward formula, therefore I need a query to return an interpolated price for a given number of "units".
DATA
ItemID Price10Price20Price35Price50Price100Price 1000
1£70£135£200£315£800£6500
2£23£31£61£89£210£1500
OUTPUT
ItemIDUnitsPrice(int)
117?
231?
So, for example
if Units <10, Then Price(int) = Price10
if Units = 17, Price(int) = Price10 + (17-10)*(Price20-Price10)/(20/10)
if Units = 32, Price(int) = Price20 + (32-20)*(Price35-Price20)/(35/20)
if Units >1000, Then Price(int) = Price1000
I'm aware that IIF statements might do the job, but I have 15 different 'Price' points, and don't particularly want to nest them all.
This problem was solved previously in Excel using a clumsy set of VLOOKUP/HLOOKUP functions in conjunction with If statements.
View 2 Replies
View Related
Dec 16, 2006
I need some help. My brain just can't grasp how to do this.
I have an Access DB. I sell vinyl records. I have an order form. When a customer orders a record, each vinyl record has a unique ID#. No two vinyl records are alike. I have four tables: Customers, Orders, Inventory, & Order Details. I have an "Order Form" form where I input all the info. It's an all-in-one form where you can view and data entry in one screen. The form has two subforms in it.
Here's the problem:
If a customer orders more than one item (i.e. a vinyl record), each Inventory_ID (representing one vinyl record) is associated with one Order_ID which is, in turn, related to one Customer_ID. If I have one Order_ID that has multiple Inventory_IDs (i.e. has ordered two or more vinyl records) that belongs to one customer, how can I calculate that total cost?
Currently, I have a calculated field within my all-in-one form that calculates only the price of the Inventory_ID that one currently sees on the subform. The Inventory_ID item has a set price, for instance $5.00. If I scroll through the ordered Inventory_IDs, the calculated field will only display the price of the product that you currently see. It's not really calculating anything, I guess. It's just bound to that field, but I need to sum up all the price fields for all the Inventory_IDs that are associated with one Order_ID & Customer_ID whether it's a query or calculated field...I just need it done so that it'll display on this form.
Any help would be much appreciated. I can show you whatever you need to see. Thanks in advance.
David
View 10 Replies
View Related
Jul 26, 2005
Ok, here's something I think I've done dozens of times, successfully. Now I can't get it to work.
I have a Parent Form with three Subforms (based on 3 separate, linked, tables).
I have a combo box on the parent form which looks up a piece of EQUIPMENT by its unique ID and the other two forms display equipment DETAIL and SERVICE HISTORY related to that equipment. It works just great until I use the ParentForm's navigation buttons. The two Subforms change to display the information relevant to other pieces of equipment, but the combo box continues to show the original look up.
Whaaaat have I done or not done here?
Thanks,
Rick
View 2 Replies
View Related
May 13, 2005
dears members,
I m trying to add document2.doc to document1.doc by clicking a button on a form.
I use the next VBA code.
Selection.InsertFile filename:="document2.doc", Range:="", ConfirmConversions :=False, Link:=False, Attachment:=False
I get the following message error:
Err.number = 5174
Err.Description = "The file cannot be found"
Try one of the following things:
* Check if you write the name good
* try an other file name (document2.doc)
The file document2.doc does really exist and is saved in the same directory as document1.doc
the problem is sometime I get the error message some times not in this last case it works very good.
can any body help me ?
Thanks in advance.
View 1 Replies
View Related
Jun 28, 2005
I'm making a macro to output a report to an Excel spreadsheet using OutputTo and would like to add the date to the filename since this is done each day and the files need to be different. So I'd have something like "Output" as the base filename and "Output20050628" as the final filename. Would someone please help me out on this? Thanks in advance.
View 3 Replies
View Related
Apr 12, 2008
I think I am on the right track, but I am stuck with importing the date from my excel filename. Currently the following code imports all Excel files from the directory into a table in my database. The excel files are saved like "ABC_BNG_GTR_04012008.XLS" The numbers represent the date. I need for the date to be extracted and place in table into the "callDate" field. When I run my code, I continue to get a runtime error 13 - type mismatch. The code stops at the Mid() statement. What am I doing incorrectly? Thanks in advance.
Option Compare Database
Private Sub btnImport_Click()
Dim strFile As String 'Filename
Dim strFileList() As String 'File Array
Dim intFile As Integer 'File Number
Dim filename As String
Dim path As String
Dim TheDate As Date
DoCmd.SetWarnings False
path = "C:UsersChinaboyDesktopData"
'Loop through the folder & build file list
strFile = Dir(path & "*.xls")
While strFile <> ""
'add files to the list
intFile = intFile + 1
ReDim Preserve strFileList(1 To intFile)
strFileList(intFile) = strFile
strFile = Dir()
Wend
'see if any files were found
If intFile = 0 Then
MsgBox "No files found"
Exit Sub
End If
'cycle through the list of files
For intFile = 1 To UBound(strFileList)
filename = path & strFileList(intFile)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "sheet2", filename, False
'Inserts date in date column based on file name
TheDate = Mid(strFile, 12, 8)
CurrentDb.Execute "UPDATE sheet2 SET callDate =" & "'" & TheDate & "' where callDate is null"
Next intFile
DoCmd.SetWarnings True
End Sub
View 14 Replies
View Related
Sep 8, 2004
I have a replicated database. I'd like to display the name of the version of the database that is being used on the data entry form so it's clear which version is being used.
What's the code for the current filename? (I'm talking about the entire "filename.mdb" file).
View 4 Replies
View Related
Aug 10, 2006
Good morning,
I have a listbox that contains dates (0105, 0205, 0305, etc.) and depending upon which date is selected in the list box, I want to import the corresponding month's text file. Here's the code:
Private Sub List64_DblClick(Cancel As Integer)
Dim frm As Form, CTL As Control
Dim VARITM As Variant
Dim X As Integer
Dim period, PERIOD1 As String
period = Me!List64.Column(4)
PERIOD1 = Me.List64.Column(0)
DoCmd.TransferText acImportFixed, "df import specification", "LOCAL DF-SL", "S:FinanceAccounting OperationsNational AccountsAccount Recs116406-Account ReconDF_" & PERIOD1
DoCmd.TransferText acImportFixed, "Rf import specification", "LOCAL RF-SL", "S:FinanceAccounting OperationsNational AccountsAccount Recs116406-Account ReconRF_" & PERIOD1
DoCmd.TransferText acImportFixed, "MDdf_import_spec", "LOCAL DF-GL", "S:FinanceAccounting OperationsNational AccountsAccount Recs116406-Account ReconMDDF_" & PERIOD1
DoCmd.TransferText acImportFixed, "MDRf_import_spec", "LOCAL RF-GL", "S:FinanceAccounting OperationsNational AccountsAccount Recs116406-Account ReconMDRF_" & PERIOD1
So I have the files saved on the above mentioned S: drive, i.e., MDRF_0105 and when the user selects 0105 in the listbox, I want the appropriate file to be imported.
This code is set on the DblClick event.
Please help!
Thank you!
View 3 Replies
View Related
Mar 13, 2012
Is there a code to get a filename to show up next to an attachment box?
View 2 Replies
View Related
Jun 6, 2006
Hi All,
I have this line of code:
DoCmd.TransferText acExportDelim, "Dhcp Specification", "tblDHCP", "U:" & [Forms]![frmExportDHCP]![cmbServer] & ".txt", False, "", 850
Where the section highlighted is a combo box on a form. I was trying to use the value in this combo box to describe the filename of the text file I was exporting to. However I get the error:
The Microsoft Jet Databse Engine could not fond the object 'X#txt'. Make sure the object exists and the you spell it name and path name coreectly.
Where X is the string stored in the combo box.
Any ideas where I have gone wrong/what could be improved?
Cheers,
Matt
View 1 Replies
View Related
Nov 3, 2004
I am trying to create a unique filename when sending a report via email in snapshot format.
As already stated in another thread, the filename comes from the report's "caption" property.
Can a unique filename be given in a case like this? I need the filename to be a series of concatenations of
field names.
This report will be sent one page at a time. And sent by seperate people as many as 100 times in a single month. And as much as 1000 times in a single year. Each page (report) will be stored on a sever. So saying that, the need for a unique filename for each time the report is emailed is very important.
Thanks for any assistance on this.
Tasha
View 14 Replies
View Related
Sep 18, 2014
For instance, I got some dynamic length path with filename as follows:
F:OUTDOOR9-8W1250832 ABCworking 1.3-0.6 BOARD 720.tif
Is there any easy way to get only the "working 1.3-0.6 BOARD 720.tif", which is the desired filename.
View 2 Replies
View Related
Jul 2, 2015
I need to import a number of .csv files every day and overwrite the old tables with the data from the new .csv files. However, each day, the filenames will change.
For example,
Day 1: Import fileA 1.csv, fileB 1.csv, fileC 1.csv
Day 2: Import fileA 2.csv, fileB 2.csv, fileC 2.csv
Day 3: Import fileA 5.csv, fileB 5.csv, fileB 6.csv
The files will be named fileA [#].csv, fileB [#].csv, fileC [#].csv, and so on, with a different number each day (with no pattern to the numbers).
Is there a way to write an import specification or VBA script that will import these? Perhaps something that allows a regular expression in the file path so I can import "C:fileA*", "C:fileB*", etc.?
View 5 Replies
View Related
May 8, 2006
I am writing some search results to an excelsheet for reports using the time and date functions to build a filename. I downloaded a StripSpecialCharacters() module, but it doesn't take them all out (only takes ascii above 127).
Does anybody know of another function to do it. searched the archive to no avail.
Thanks in advance
View 5 Replies
View Related
Jan 25, 2014
Need a formula which can capture filename for me. For example, I have a db saved at "C:DlocationofficeChina.accdb". Is there a way to capture "China" in a query?
View 2 Replies
View Related
May 7, 2015
The code below sets my printer to "Cute PDF writer" and then opens a report in print view, which creates a PDF version of my report. So far so good. But just before the last step, it brings up the Save As dialog box, asking for a filename and location.
Three points are important:I always want to call the PDF document "Specialty Report".I always want to save it to C:Documents and Settings80435 Desktop. I always want to overwrite the previous version.
Is there some code I can insert that would achieve this automatically with no further user interaction i.e. user clicks a button and the PDF file is created/overwritten?
Code:
'Produce the report
Dim defPrinter As String, NewPrinter As Printer
defPrinter = Application.Printer.DeviceName 'Get the default printer name
Set NewPrinter = Application.Printers("CutePDF Writer") 'Create a new printer object
Set Application.Printer = NewPrinter 'Set the default printer to the new printer
DoCmd.OpenReport "Specialty Report", acViewPrint 'Open the report in print view (which will PDF it)
Set NewPrinter = Application.Printers(defPrinter) 'Reset the printer back to the default printer
View 3 Replies
View Related
Jan 8, 2014
I have a table named tbl_imagepaths with fields:
ImageID
File
Folder
The command button has the code below, it works great and pops up with a window with the file name and path. I now just need the code to insert the file name and path into the table....
Code:
Private Sub Toggle7_Click()
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
[Code] .....
View 7 Replies
View Related
Jan 21, 2013
I am working on supporting spaces in the DB filename. I got the rest of my program working... other than being able to invoke Access with the specified filename for it to open.
Code:
C:Documents and Settingsc_mlueckMy DocumentsFandango>"C:Program FilesMicrosoft OfficeOffice12MSACCESS.EXE" "Schema Ideas.accdb"
C:Documents and Settingsc_mlueckMy DocumentsFandango>dir "Schema Ideas.accdb"
Volume in drive C has no label.
Volume Serial Number is C8E4-5856
Directory of C:Documents and Settingsc_mlueckMy DocumentsFandango
01/18/2013 04:45 PM 3,203,072 Schema Ideas.accdb
1 File(s) 3,203,072 bytes
0 Dir(s) 125,846,482,944 bytes free
The envoking of MSACCESS.EXE results in:
Does Access 2007 MSACCESS.EXE not support DB's with a space in the file name being spefied to auto-open via command line switches?
View 3 Replies
View Related
Aug 14, 2015
I need to import 300+ individual .txt files into a MS Access DB table (named "tbl_input"). Each of the the .txt files have a naming convention similar to this:
Pink_Floyd_YYYYMMDD.txt
Because this initial import is so large and I would like to avoid doing it manually, I need to be able to:
import each of these files into a single table
delimit the text in each based on the "|" symbol
add the filename into an empty field
View 1 Replies
View Related
Oct 8, 2013
Is it possible to create a button that automatically saves a report as .pdf? And automatically generates the filename.
Like 0810-544 (0810 is the date and 544 is the ID from the form.)
View 14 Replies
View Related
Jan 30, 2015
My access is 2013.
Suppose there's a simple query which has two fields, "year" and "graduates", where "year" can be grouped by "2012", "2013", etc and "graduates" are individual names.
How can I export the list of graduates to multiple excel files, with the filename based on "year"?
I have tried to set the output file in macro as "c:desktop" & query.year & ".xls"
But it's not working and the output filename is exactly "&query.year&.xls "and the file contains all year and all names.
View 14 Replies
View Related