Thanks for quick replies.
You were right JerryKlmns. The ADO 2.1 reference was listed first and so had priority.
My other databases were converted from Access 97 to XP, and so didn't have the ADO 2.1 reference, hence why they didn't require the DAO.Recordset ref.
Thanks again.
Looking at another thread has given me the answer:
Instead of
Dim MyRs as Recordset
I needed to use
Dim MyRs as DAO.Recordset
Still seems strange that my other databases worked ok though!?
Hi
I'm using Access XP, and having a problem with the OpenRecordSet method. If I try the code below, I keep getting a type mismatch error at the 'Set MyRs' line.
Function testit()
Dim MyDb As Database
Dim MyRs As Recordset
Set MyDb = CurrentDb()
Set MyRs = MyDb.OpenRecordset("MyQuery")...
Thanks dhookom. That worked perfectly.
randysmid: Had a quick look at Access help but couldn't find anything that referred to this. Will try when have some spare mins. Thanks anyway.
Is it possible to force Access to print the totals from a group_footer next to the last entry in the details line eg assume Apples and Pears are two records from Details Section, and Total is sum of two in Fruits_Footer, I want report to look like:
Apples 24
Pears 12 Total: 36
Instead of...
As dhhookom said, it depends how you are filtering the records.
If doing via the query you can set the parameter to 'Like *' which picks up everything.
If via the report itself set the Filter On property to False ie me.filteron = false within On Open Event, or empty the Filter property ie...
Think the problem lies with the formatting. Your query is expecting a string as the parameter, but Job_Ref is an autonumber, even with the formatting!
What's happening is Access is still storing Job_Ref as a number, it just formats on the fly to make it look like a string eg Stored as 12345...
The solution is to copy the contents of the whole table as a simple Make Table query:
First create an ODBC link to the Sage table (I've used 'scheme_stockm' in this example)
Then create a Make Table query to import this data to a new table (I've called new table 'Stockm_Import')
SQL:
SELECT...
I am using Excel 97 on Windows XP.
Every now and then I get an error which causes Excel to shut down. If that isn't bad enough, when I then go to re-open the file I get a message:
FileXYZ.xls is locked for editing by 'Leon'
and I can only open the file in read-only mode.
I'm 'Leon' and the...
I may be wrong, but I don't think Access gives a way of accessing specific tables through VBA. I use ODBC a lot through Lotus Notes, and have found I need to link each table manually through File -> Get External Data -> Link Tables.
If there is a way of doing it in VBA I'd be very interested.
Just checked the code and it works ok.
Are you entering the call directly in the OnCurrent Event box or as an EventProcedure?
It should be directly in the box and Access should reformat it to look as:
=DisableEnable([Form])
ie there should be square brackets around the word Form.
HTH
LeonH
I have a report that prints information grouped on different departments. At the bottom of each page I have the standard 'Page 1 of 20' footer using &Page and &Pages.
For each group I would like to be able to print the number of pages for just that group and then reset it for the next group eg...
Add a new unbound textbox and call it 'Average'.
Add your command button and in the OnClick Event enter
me!average = (val(me!quarter1)+val(me!quarter2)+val(me!quarter3)+val(me!quarter4))/4
Now when you click the button it'll display the average on your form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.