I have a split database with a frontend that I semi-regularly update (when one of my users finds a bug I never would have thought for looking for). On my menu screen i have a text box that says: "Last Updated: ##/##/####".
At the moment I manually update the date every time I update the frontend.
Is there a way I can use the DateModifed property of the .mdb file for the frontend as the date in my textbox using VBA?
I have a graph chart and my row source type is a Query. So I retrieved data from the Query that I built.
However , I want to get the data from the uploaded excel file.
I have a form that will prompt user in the beginning to upload the excel file and replaced the old table in Access- "CrossSystemData"
Basically , I want to pull data from Excel file , Run the query(Data from excel file) then excute to "display a chart based on my query" ... Is it possible ?
Query SQL: "PolyWrongRegInsCount"
Code: SELECT GROUPING.INSTITUTION, Count(*) AS NO_OF_GROUP FROM (SELECT DISTINCT CATEGORY, GROUP_NO, INSTITUTION, IIF(Left(INSTITUTION,1)="P","POLYCLINIC","HOSPITAL") AS INS_TYPE FROM CrossSystemData WHERE INSTITUTION NOT LIKE "*UNKNOWN*") AS GROUPING WHERE (((GROUPING.CATEGORY)="WRONG REG") AND ((GROUPING.INS_TYPE)="POLYCLINIC")) GROUP BY GROUPING.INSTITUTION;
My Chart SQL :
Code: SELECT PolyWrongRegInsCount.[INSTITUTION], PolyWrongRegInsCount.[NO_OF_GROUP] FROM PolyWrongRegInsCount;
I have an existing Access Database which has a lot data, new records get added every day and a few are modified as well.
I need to write a script/query/exe which will get modified records(since last execution of same script etc.) from Access and export them to a CSV file.
My problem is getting those modified records.. Is there any default timestamp field in Access which can be used? Or do I have to add a new timestamp column for every table?
I have a form with 4 subforms on it and I am trying to find a way to capture the last modified date for the record regardless of what form or subform they touched
Is this possible?
Right now I have a macro on before update of Now() on the form and all of the subforms but that is only showing when that form was last modified which is not exactly what I am trying to achieve.
I have a subform that is filtered by a textbox on the main form. Is there any way I can add a timestamp to a record on the subform when a user changes anything on that record?
I've tried the Macro that is listed on Microsoft's website regarding timestamps, but I had serious issues implementing that to a subform.
How do I set up a field so that when the record has been modified, the field is automatically filled in (or replaced) with a date? In other words if I open up my member's detail form, and go to Sally Smith and edit her information on 11 July 15, that date is saved into a field called last modified and then updated every time I go into her file and edit & save it.
Lets hope that after finding this forum, my slight problems will begin to ease off a little.
I am unfortunately one of those newbies trying to get in well above my head and level of ms access workings, but we all have to start somewhere, right?!
My problem at the moment is as follows:
The scenerio is i work for an excursions provider in Cyprus and I am trying to set up an online excursions site for them.
Now with any excursion, the price flutuates through the year when its low season, high season etc. I have built a MS Access database with the following tables so far. Excursions details: this contains everything about the excursion on offer, along with additional columns for the price changes and dates that these apply for. ie. [adprice1][fromdate1][todate1], [adprice2][fromdate2][todate2] etc
Now what I am trying to acheive if at all possible is that when a viewer takes an interest in an excursion and selects the date they would like to go on the excursion, that the correct price is displayed for that specific time period i.e if it the date was betwen [fromdate1][todate1] or [fromdate2][todate2]
Is this at all possible and if so can someone please explain to me in real laymans terms what I need to do for this too occur within the database please.
Thank you in advance and sorry for waisitng anybody's time if this seems obvious to others and not myself!
I have a table in my Access 2010 Database with few date/time fields. I have set different formats like Short Time, Medium Time etc. But when I link this table to Sharepoint list, all the date/time fields have been modified to their default format (General Date).
Is there a way we can keep the formats as such even after linked to Sharepoint list? If not, is there a workaround?
I am trying to retrieve data for a particular record.
When Project field matches a certain project number I want it to pick the record with the latest date in the date field field to select certain data fields(Owner & Rating) from that record.
Below is my attempt. However the problem is that displays all records with that project number and not just the record with the latest date.
Code: SELECT [Combined PRB Roadmap].ProjectNumber, Max([Combined PRB Roadmap].DateField) AS MaxOfFDateField, [Combined PRB Roadmap].Owner, [Combined PRB Roadmap].Rating FROM [Combined PRB Roadmap] GROUP BY [Combined PRB Roadmap].ProjectNumber, [Combined PRB Roadmap].Owner, [Combined PRB Roadmap].Rating HAVING ((([Combined PRB Roadmap].ProjectNumber)="NR-4237"));
I have an Access Database that I will be using on a desktop. I have a table in this database that mirrors the structure of a table on a remote server in a SQL database. I have successfully created a vba function within the Access database that uses a server-side php subroutine to select records (I usually won't know how many) from the SQL database and return them to the access database. The code I use in the access vba subroutine to access the php subroutine is:
Code: With CreateObject("Shell.Application").Windows Set ieWindow = CreateObject("InternetExplorer.Application") ieWindow.Visible = False apiShowWindow ieWindow.hwnd, SW_MAXIMIZE ieWindow.Navigate "Web address for server-side php file" End With
The last command in my php subroutine is "return $retrievedData." $retrievedData is a multidimensional array containing data from 42 fields in multiple records (again, I usually won't know how many). I've checked the data in php so I know it has been stored correctly.how do I access the returned data within my access vba subroutine?
I should add that my overall reason for doing it this way is that I want to maintain my server-side database as an untouched master. Users can only add data to it. My client-side database is used to update the input table and further process the data. The subroutines described above are intended to retrieve "new" records only (i.e., records posted since the last access database update) from the server-side database and transfer them to the access database for further processing.
Continuing with production of my database I've come across another wall that I'm trying to pass. My aim is when the user press the "Quit" button it will export everything to a file which is stored on Google Drive as google drive is installed on the laptops that will be using this database.
However the problem is Google drive is stored in the computer user files i.e C:UsersstudentGoogle Drive - is there a way to retrieve the name of the user that is logged into windows?
Code:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal IpBuffer As String, nSize As Long) As Long Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lpBuffer As String, nSize As Long) As Long Function ThisUserName() As String Dim LngBufLen As Long Dim strUser As String
[code]....
However cant get this to work - I think that is probably because i'm declaring this code in the wrong place - I've tried declaring the private functions in a class module and the functions in a module - however no success - How do you set this code up? Or is there a new way to do this?
Public Function OdometerInput(varodometer As Variant) As Long Dim varKilometres As Variant varKilometres = varodometer * 1.609344 OdometerInput = CLng(varKilometres) End Function
It works fine in the immediate window (although I haven't just fathomed what to do with null values and such) But my question which I am sure will be 'easy when you know' is how do I pass the variable to it from a text box on a form and retrieve the data in another text box on a form.
Front end Access 2010, back-end SQL-server 2008 R2.
Normally I retrieve a certain value by Dlookup("myvalue", "mytable",...)
or
strSQL = "SELECT myvalue FROM mytable...;"
Set rs = CurrentDb.OpenRecordset(strSQL, 4)
But is there any faster way to retrieve a single value from an SQL-server table, beside doing doing the select by a stored procedure running through a pass through query, then open a recordset
Set rs = CurrentDb.OpenRecordset("mypassthroughquery")
just to retrieve ONE value?
I could not find something like DLookup("...) for an SQL-Server or in T-SQL.
So I currently have a module which automatically backs up my database to a separate file everyday on open of my database.
If is it possible to create a function which will allow me to delete these backups after a certain amount of days (eg 30 days). They all have different file names based on the time that the backup was created but have the same extension of "*.accdb". I ask because it stores EVERY backup so the storage space required will soon build up unless manually deleting the files which is not what my client will want,
I have tried using the "Kill(pathname)" function but have had no luck yet!
If possible, I would like this to be done automatically either on open or on close of my database.
What I would like to achieve via code on a button. From the table orders
Code: orderDate orderID ref name amt vat 02/02/2014 56789 01 magdi 600 100 22/06/2014 12122 01 magdi 654 100 22/06/2014 65897 02 simon 250 159 22/06/2014 12345 02 simon 156 140 23/07/2014 56781 01 magdi 400 250 01/08/2014 12457 01 magdi 250 900 01/09/2014 56787 02 simon 126 500 02/09/2014 56781 04 peter 400 250 02/09/2014 12345 02 simon 450 122 02/09/2014 65897 04 peter 250 231 02/09/2014 12122 05 hargr 654 100 02/09/2014 79457 05 hargr 254 200
I need to create csv files from the above based on unique date and ref and with filename showing date and ref. So from the above we should get 9 csv files in this format
I want to save NOW() (i.e. Date and time) into an event log file. But I just cannot work out the syntax. My insert statement works fine without the date field in, but fails on a syntax error (3134) when I include it.
Send an email with an attachment.What do I want to attach?A PDF document that I have already uploaded to access and appended to the record I'm currently viewing.I can't find a way to attach a document I have uploaded to access. I'm not even certain sendobject supports that. I can't find any information on that anywhere.