Two Logical Problems?
Aug 26, 2007Hi,
I’m using MS Access 2000 – I’ve been building, using and updating an Access database for a while now, and I’ve been living with two problems that are causing problems to its use.
The first problem appears minor, but relates to the second problem….
I keep the database in my shared documents folder on my PC, so a colleague and I can both use it at the same time.
When we have the same form open – if I click on the “save” icon it comes up with an error “you do not have exclusive access to the database at this time” and the recordset that I am working on cannot be saved. This is causing problems because if I enter fresh data into the form, and then click a command button to run a query against it, it comes back with blank results because it has not been saved to the table yet – so I have to exit out of the form so it saves the data, then go back into the form so the query runs properly.
Are there any settings I can apply so I can save the data to the table without having to exit and re-enter the form again?
The second problem is more difficult and has had me tearing my hair out for a very very very long time – if anyone could help me with this problem I would be indebted to them…
After I’ve entered all the data into my form, I need to export/transfer 4 of the fields to a .csv file.
I would have thought that the logical thing to do would be to have a command button that performs a macro, which it turn;
Saves the data to the table
runs a query which selects the 4 fields I require
then exports the Query’s results to the csv file.
When I’ve tried this, obviously the problem of saving the data remains, but even when I exit out of the form and re-enter so the data has been saved to the table – I can’t get the export to work!
I’ve tried exporting the query manually from the query view, however it comes up with an error stating that “TOO FEW PARAMETERS. EXPECTED 1”
I’ve tried Macros that “Outputs to” and “Transfer Text” – however I can’t get any of them to work. I managed to export a table and save the export procedure, then tried to use this procedure when exporting a query, but again I couldn’t get this to work. I’ve also tried adapting VB codes that have been posted on this forum before, however as I’m not too hot on coding I’m not sure whether I’ve been making mistakes or if there is something wrong with the architecture of my database that is preventing the export from working.
Would anyone be able to take a look at the database for me please? I’ve uploaded it here – http://www.qualitytoolsltd.co.uk/accessdatabase.zip - I’ve deleted everything except for the tables, queries and forms that rely on the export query.
It contains a table (“Orders”) that stores the form’s data, a query (“QuotefromorderstblQuery”) that filters our “Quotes” from our “Orders” (I keep “Quotes” and actual “Orders” in the same table but have a [Quote/Order] field that distinguishes them apart), and a form (“QuoteEntryForm”) that is linked to the query to show our Quotes.
Also included is the query (“exporttocsvquery”) that I am trying to export to a csv file. On the form there is a command button called “Run CSV Query” that runs the query – but I’ve deleted all the various buttons and code that I’ve tried to get it to export to avoid confusion.
Also on the form is a button called “Process Order” – this can be ignored as clicking this just changes the [Quote/Order] status to “Order” and the recordset won’t show on this form anymore.
If anyone could please try and help me understand how to overcome these problems – I would be extremely greatful!
The four fields that I am trying to export are;
[Customer Name],[Customer Address],[Customer Postcode] & [Total Selling Price inc VAT] – I have highlighted them with red text on the form
If I can solve the first problem of saving, what I am trying to achieve is the creation of a Macro, which is programmed to:
1.Saves the data to the “Orders” table
2.Runs the “Exporttocsvquery” using the Order ID as the select criteria , so it shows the current records being displayed on the form as the query’s results.
3.Exports the Query results to a .csv file on my hard drive.
4.Launch a custom application that I’ve programmed to run using the data in the .csv file.
Thank you very much for taking the time to read this marathon post. Any help, advice, guidance, anything at all would be appreciated very much indeed.
Thank you again.
Dean Rowe.
deanrowe [at] qualitytoolsltd.co.uk