I would like to add the "Month" of the information queried to my file name at export if possible. I included my current code and an example of how I would like the title to read.
I have a form that contains a field with an On Click event procedure to send the value in that field to a corresponding field on a subform attached to another form. Does that make any sense? The On Click procedure looks like this:
I’m not quite sure what I am doing wrong. I am getting the Run-time Error ‘2465’ and it is pointing out that it is unable to find field ‘fsubSubFormName’. I have double (and triple) checked the names and I have not misspelled the names of the form or subform. Did I set up the event incorrectly? Could it be that I am not calling the subform the correct way? Any ideas? .....
hi, I am new to this forum and to MS Acess. i am not a software engineer or in the field of software. I had to learn as much as i could about MS Acess because of a project i worked on. I have a standalone MSacess database and one of the forms is giving me trouble when I try to enter a new record
The form is called frm_fragrances and has information about a fragrance. the frm_fragrances has 4 fields in it and a sub form. the sub form has details about the fragrance
In a new record when I enter the 4 fields and attemt to go to the subform which has details about this fragrance I face this error.
an unexpected error haas occurred @2465: application defined or object defined error.
additional information Active form:<frm_fragrances> Active control:<txt_VendorName> Previous control:<frm_fragrances>@Please call the developer for further instructions
I have looked in the FAQ and on this forum for help on error 2465 and cannot find anything to help me. I can work with forms to an extent but cannot write too much code.
I would really appreciate some help in this matter Thank you
We have an old computer that is going to be used as a simple signin and out book for volunteers. We want to restrict people on that computer from doing anything else
I have designed the form, and it is nice and evil in that it doesn't allow you to close it (cancel = true in the forms unload event) or even quit access without killing the process manually with the old ctrl-alt-del (or ctrl-shift-esc) it starts on startup and I have disabled the windows key (using XP so I had to add a binary value to the registry manually)
The problem is they can still alt-tab out of there (despite a NoWinKeys registry key that was supposed to stop that), and they can still change the main access window's size and access the start menu.
The network and local profile is such that they can't do a whole lot if they do get past the form, but there should be a way to stop them from leaving... some sort of API that will regain the focus, then I could just check that the application had the focus every second, and pretty much render the computer un-usable
hi guys i was wondering if you can help me this is my code: i have a main form with this code, this form contains a subform linked by the All_PricingID
Set rst = CurrentDb.OpenRecordset("tblAll_Pricing") 'main table ' adding data to the table rst.AddNew ' Main table rst!All_PricingID = Me.txtPricingID 'Main table pk rst!MainContract_ID = Me.cmbMainContract 'combo box in parent form rst!ItemNumber = Me.txtItem 'Main form text rst.Update
'sub Table Set rst2 = CurrentDb.OpenRecordset("tblPricing") 'sub table For varItem = 0 To Me.lstsubContracts.ListCount - 1 'this is a list in the main form '--- loop through all the items in the list box and create a new row in the subform for each subcontract in the listbox lstSubcontracts. rst2.AddNew rst2!ID = Me.All_PricingID 'sub table foreign key rst2!SubContractID = Me.lstsubContracts.Column(0, varItem) 'sub table rst2.Update Next varItem '--- close the tables rst.Close rst2.Close Set rst = Nothing Set rst2 = Nothing
the subform appears correctly with the rows i wanted added but i need the user to be able to edit a column in the subform for the rows just created (my form is on datasheet view). but everytime i move to cursor into the subform, i can't even scroll up and down.
i keep getting an error that says :
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. (Error 3022)
but when i check my tables tblAll_Pricing and tblPricing , everything is inserted correctly according to my recorset above, do you know why this is happening? and why i am not able to edit my subform. my subform allowsedits and additions.
I try to use common naming conventions wherever possible. Every now and then I come across what should be common but I can't find a standard method to use.
It not really a huge problem, but as this is the General forum I thought I'd ask.
Does anyone have a good link with a long list of conventions?
Does anyone have a standard way to name a table which permenantly resides in the client but the data is very much temporary.
I use these tables a lot and was just interested.
No matter if there isn't one, just seems a good idea to open up a discussion for anyone else who wastes time like I do on the name of objects etc. rather than doing the work:-)
Following on from entries in a previous post (see http://www.access-programmers.co.uk/forums/showthread.php?p=612071#post612071 ) I wondered what people considered to sensible naming conventions.
For example should a table be called "Order Details", "Order_Details", "OrderDetails" or "tblOrderDetails".
Should variables in VBA be given a prefix which indicates their type eg strString or intInteger etc.
Not only do a lot of people not format code (nothing a copy/paste dump of 300 lines with no spacing), they use control names like textbox1, combo47, and form12. It drives me bonkers. This is in part from Expert One-on-One Microsoft Access Application Development. Please read it and understand it. (The book isn't bad either.) Reagrdless of whether or not you agree with it, the point here is that you use some sort of naming convention, even if it's not this one as variants exist. Without it, maintaining your code is exponentially harder, and asking for help in here without some sort of standard convention is far less likely to get a response.That is all. :)Leszynski Naming Conventions (http://en.wikipedia.org/wiki/Leszynski_naming_convention)
i have the following code and it works fine makes a xls called trash
now i want to be able to name the xls myself (via a form) form called xlsexport and the field i wil have to name it willb e called xlsname
is it a simple case of
objActiveWkb.Worksheets(1).SaveAs FileName:="c:[form]![xlsexport]![xlsname]- this doens't sound right to me ??
code below( yes theres some bits in there i need to tidy i know)
Private Sub Command0_Click()
Dim dbs As DAO.Database
Dim rstGetRecordSet As Recordset
Dim objXL As Object Dim objCreateWkb As Object Dim objActiveWkb As Object
Set dbs = CurrentDb Set objXL = CreateObject("Excel.Application") Set objCreateWkb = objXL.Workbooks.Add Set objActiveWkb = objXL.Application.ActiveWorkbook
Set objActiveWkb = Nothing Set objCreateWkb = Nothing Set objXL = Nothing rstGetRecordSet.Close dbs.Close Set rstGetRecordSet = Nothing Set dbs = Nothing
Is it possible to set a naming convention for auto numbered records?
For instance in a table that holds information on customers, could you start the auto number scheme at something like 'cust01' rather than the normal autonumber scheme that's starts at 1 and continues.
I'm looking to design a form in Access that has a documents number field. Ideally, this field would auto-generate a document number based on a logical naming convention.
I have a Database in which I would like to archive data once it is now longer actively being used. I have VBA code that does everything i need it to, however I would like to name the new archive table related to the dates in the data being archived. Below is the code I am using to archive and delete the information from the main table.
Code: Dim strSQLCreate As String Dim strSQLDelete As String Dim strArchiveTableName As String
[Code].....
I know it will be in the "strArchiveTableName" variable, I am just not sure how to pull the dates out of the data being moved. The TestData table holds a date and time for each test, and the earliest and latest dates is what i want to append to the table name.
For example: Currently "tblTestData_A102Archive"What I want "tblTestData_A102_1/1/2012-1/1/2013"
Im putting up my Access table/query names for critique, because at some point Ill have to hand over this database to someone else and I want to see how they might react. So if you opened a query list and saw the list below, would you be able to find your way around, or are there too many similar looking queries?
Some of the queries are made up of 6 or 7 of the other queries. I find its easier to see what going on if they are separated out into individual queries, rather than throwing them all into a single select statement, and it means I can re-use things that I know work.
I get stuck on using plurals vs singular (e.g. StoresDeductions or StoreDeductions); how much detail to put in (e.g. BrokersChainsStoresCasesByMonth); how to indicate totals or being grouped by e.g. month; how to indicate date parameters, i.e. whenever a query says MonthRange it asks for this range, and any queries built on top of this one also have MonthRange in their name.
I'm not talking about naming conventions as in tblThis or qryThat, but I have 100+ queries, many of which do similar things from slightly different angles - e.g. a query that gives the total sales per store per month; the same query but per store per product per month; the same query but per sales manager per store per month etc. And these are then used in queries further up the tree that also have similar but slightly different results.
So is there an example database anywhere that I can download that has a decent amount of queries, and a sensible naming convention? I think I'm tying myself in knots because I have only a few tables but lots of queries (for data analysis), whereas most databases I see have lots of tables and a handful of queries.
I'm currently working with Access 2007 building a way to create PODs to clients. I have most everything laid out, one problem I can't seem to get around is naming the file the SOW #. Below is the code:
Function Run_all_PODs_01() Dim myPath As String Dim name As Object
DoCmd.OpenQuery "Q5 SOW bill requested data points all", acViewNormal, acEdit DoCmd.OpenQuery "Q5 SOW bill requested All 01", acViewNormal, acEdit
[Code] ...
I can't seem to get the name to equal the SOW number.
The table that I'm trying to reference is "SOW bill requested data points" it is a basic table one row with a column header as SOW #. I'm not sure how to tell it name the file that data point in the column.
I have taken over exisiting databases and the names for the tables,forms,queries,reports are not technically named correctly.. What would be the easiest way to rename everything accordingly:
tbl for table qry for query rpt for report mcr for macro bas for module frm for form.
Of Course they have names but it is hard to tell when viewing a query for instance if you are looking at a table or a query.... in the SQL View.
Been hunting a round looking for some code that will output my access report to excel but more inportantly add a unique field from the report to the name of the file. example would be [FileName] & [ReferenceNo].xls.
I am exporting a single record to a spreadsheet. The code I have works fine. The problem is I want to have the spreadsheet contain the information that is in one of the forms textboxes, in this case a dogs name.
I have created a query to get the dogs name which works but I dont know how to get that query to run and then be put in the file name.
The code that I have is below
Code: Private Sub btn_ExportDog_Click() Dim strday As String 'The date Dim sDest As String 'Where the file will be copied to Dim sSource As String 'The name of the file to be copied Dim strDogName As String 'The name of the dog that is geting exported Dim strBackUp As String strBackUp = "c:GPandDetectionDogTrainingLogBackUp"
I need to create a word file (it needs to be word) based on template (not a very complicated template) max 1 to 1 and 1/2 pages long.
the word doc needs to be named from the recordset but for now assume 12345.doc and the next one will be 12346.doc etc (I have a unique number system - available from tables /query .
i can either make the word doc in code or use a template (template would be better) recordset could have 20-30 in it each time i run it - but to be run every week
second half is how to email this out. i had in mind a email system
email to . test@testhotmail.xyz file attach = this folder where the docs are store and attach 12345
in a loop
so either
create word file - email word file in a loop each time or create all the word files and then send them individual