473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

preparing to do something difficult

AccessIdiot
493 256MB
Hello all,

A while ago I got a lot of help on building a bunch of forms tied to a somewhat complicated db. Now I'm back with a search form question.

The guys that I built the db for - they asked me to create a bunch of tables based on questions they would ask of the db. This required me to create a bunch of queries - none too difficult but they accessed a number of tables. I also built some crosstab queries based on the results of other queries.

Now they would like me to build them some kind of search form so that they can ask their questions of the data without having to go through me. So I need to build some kind of easy-to-use search form (I'm assuming utilizing a bunch of listboxes) that will spit out some tables that can be exported to excel (because that's what they are familiar with using for formatting for reports, etc).

So my question comes to this: given a limited knowledge of Access (I cut my teeth on this project) is something like this doable? I know it's doable for an expert, I'm asking if its doable for a beginner to intermediate who can understand code and alter given code she finds on the internet, but isn't a programmer from scratch.

Examples of tables: general trawl data (date, trawl number, staff, location)
Catch data (trawl number, specimen id, number caught, disposition at time of capture, disposition at time of release)
Specimen data (specimen id, specimen name, scientific name, genus)

Examples of questions:
Number of specimens ordered by number caught and name grouped by location
Number of specimens ordered by number caught and name grouped by date by location
Number of specimens ordered by number caught and name grouped by date by location and release dispostion

Thanks for any advice (including "give it up now sister"), insight, and/or links to examples!!
Dec 11 '07 #1
14 1739
ADezii
8,834 Expert 8TB
Hello all,

A while ago I got a lot of help on building a bunch of forms tied to a somewhat complicated db. Now I'm back with a search form question.

The guys that I built the db for - they asked me to create a bunch of tables based on questions they would ask of the db. This required me to create a bunch of queries - none too difficult but they accessed a number of tables. I also built some crosstab queries based on the results of other queries.

Now they would like me to build them some kind of search form so that they can ask their questions of the data without having to go through me. So I need to build some kind of easy-to-use search form (I'm assuming utilizing a bunch of listboxes) that will spit out some tables that can be exported to excel (because that's what they are familiar with using for formatting for reports, etc).

So my question comes to this: given a limited knowledge of Access (I cut my teeth on this project) is something like this doable? I know it's doable for an expert, I'm asking if its doable for a beginner to intermediate who can understand code and alter given code she finds on the internet, but isn't a programmer from scratch.

Examples of tables: general trawl data (date, trawl number, staff, location)
Catch data (trawl number, specimen id, number caught, disposition at time of capture, disposition at time of release)
Specimen data (specimen id, specimen name, scientific name, genus)

Examples of questions:
Number of specimens ordered by number caught and name grouped by location
Number of specimens ordered by number caught and name grouped by date by location
Number of specimens ordered by number caught and name grouped by date by location and release dispostion

Thanks for any advice (including "give it up now sister"), insight, and/or links to examples!!
What you are describing could become very complex in that you would have to create some kind of Criteria Form then dynamically build a SQL String involving multiple Tables and Joins, Sort Orders, Grouping Levels, etc. reflecting those options made. The easy way out would be to have 'them' submit a list of proposed questions, enter then into a Table, create a Combo Box listing these questions, then create Stored Queries reflecting each question. Depending on the selection, the appropriate Query would be executed, Exported to Excel, etc. It would also be easy to Add/Remove questions and their associated Queries. The alternative, I'm afraid, could be very complex. Wait and see what some of the other Experts/Moderators have to say on the Subject before you make a decision.
Dec 12 '07 #2
FishVal
2,653 Expert 2GB
Wow.

Looks like you are charged to design super-userfriendly query builder feature.
Would it be easier to train that guys to use Access query builder than to code logic translating questions in English to answers in SQL?

Regards,
Fish
Dec 12 '07 #3
NeoPa
32,556 Expert Mod 16PB
Hi M :)

Those specimens still active up there on the North-West coast?

What you're considering is like a query design engine. It's possible, but a little strong for someone at your level.
Don't get me wrong, as I racall you were certainly not stupid, but not vastly experienced on the db side either.
As I see it, a task like this would rely very heavily on your ability to understand and code (very) logically. Many otherwise good programmers can't do engines simply because the logic requirement is too much.
Think of the requirement to build SQL strings in VBA which are then run through the SQL interpreter. Many struggle with understanding which parts need to be processed before adding to the string and which are added to the string for later processing by the interpreter. Designing an engine involves similar (but obviously more complex still) issues.
Dec 12 '07 #4
AccessIdiot
493 256MB
Thanks to all who replied. :-)

It is as I guessed - probably a bit over my head at this stage. I like the idea of offering some canned queries in a list. This project is something like a 10 year deal where they go out and do the same stuff for a few months every year. So I have 2006 data, they are now working on 2007 data, etc. I know that some of the questions will be the same every year, so the canned queries is great, but I know that based on the answers they will want some custom queries as well.

Maybe a training is in order, though they are biologists and I don't think have the time or desire to learn Access. Maybe I just go for job security and convince them that they need to go through me to get the data they want. :-)

Again, thanks for your honest answers and creative solutions!

Cheers,
Melissa
Dec 12 '07 #5
AccessIdiot
493 256MB
The easy way out would be to have 'them' submit a list of proposed questions, enter then into a Table, create a Combo Box listing these questions, then create Stored Queries reflecting each question. Depending on the selection, the appropriate Query would be executed, Exported to Excel, etc.
Okay so I've talked to some folks and we've decided that this is, at the least, a good place to start (we've also proposed getting me some advanced Access training - yay!).

QUESTION 1: I imagine its as simple as creating a table with an autonumber pk and a memo field that holds the questions yes? Then I make a form with a combo box that holds the questions and each item in the combo box is linked to a query I have already built?

QUESTION 2: Okay so if the above is correct here's another question - would it be possible/not too hard to have checkboxes or dynamic listboxes for what fields to show in the query?

That is, say they want to know number and type of specimens by locations. I have a query for that but they want to see some attributes from the table like, which ones are fish, which ones are native species etc. Would it be possible to generate that on the fly? Or is that the same type of very advanced stuff that I was alluding to in my original question?

Thanks for any help!
Dec 13 '07 #6
AccessIdiot
493 256MB
Okay, thinking more about this. If in my canned query I have a "select all" and it spits the result out into a results page. Could that results page then have controls on it that would allow the user to show/hide certain fields before pressing a button that spits the table out to Excel?

That's not too hard right?

Thanks again all. :-D
Dec 13 '07 #7
NeoPa
32,556 Expert Mod 16PB
You could certainly have a form with CheckBoxes that determine which controls are visible and which hidden. These same CeckBoxes could be used in the Export coding to determine which fields to include in the Export.
This is getting a little "Engine"y, as the SQL string would need to be updated on the fly and inserted into a temp or template QueryDef, but quite do-able.
Dec 13 '07 #8
ADezii
8,834 Expert 8TB
Okay so I've talked to some folks and we've decided that this is, at the least, a good place to start (we've also proposed getting me some advanced Access training - yay!).

QUESTION 1: I imagine its as simple as creating a table with an autonumber pk and a memo field that holds the questions yes? Then I make a form with a combo box that holds the questions and each item in the combo box is linked to a query I have already built?

QUESTION 2: Okay so if the above is correct here's another question - would it be possible/not too hard to have checkboxes or dynamic listboxes for what fields to show in the query?

That is, say they want to know number and type of specimens by locations. I have a query for that but they want to see some attributes from the table like, which ones are fish, which ones are native species etc. Would it be possible to generate that on the fly? Or is that the same type of very advanced stuff that I was alluding to in my original question?

Thanks for any help!
QUESTION 1: I imagine its as simple as creating a table with an autonumber pk and a memo field that holds the questions yes? Then I make a form with a combo box that holds the questions and each item in the combo box is linked to a query I have already built?
Correctamundo!

QUESTION 2: Okay so if the above is correct here's another question - would it be possible/not too hard to have checkboxes or dynamic listboxes for what fields to show in the query?
Definately possible with a fair degree of difficulty.

That is, say they want to know number and type of specimens by locations. I have a query for that but they want to see some attributes from the table like, which ones are fish, which ones are native species etc. Would it be possible to generate that on the fly?
It all can be generated on the fly, but you are getting so ever closer to your original request.
Dec 13 '07 #9
AccessIdiot
493 256MB
It all can be generated on the fly, but you are getting so ever closer to your original request.
Yeah that's what I thought. :-\

Okay, baby steps then. :-)

I feel really stupid for asking this but I think I just need a refresher - how do I attach the queries I've already built to the items in my combo box? Do I use the onchange event to fire off the sql code depending on the query id?
Expand|Select|Wrap|Line Numbers
  1. //pseudocode: if queryid = 1 run query1; if queryid = 2 run query 2; etc
  2.  
I'm sure there must be a better way to assign the query to the value?

thanks!
Dec 13 '07 #10
NeoPa
32,556 Expert Mod 16PB
You store the name of the query in a field in your table (QueryName).
When your record is selected on the form, you execute code that calls :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenQuery(Me.QueryName, ...)
to see the results or :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet(Me.QueryName, ...)
to export the results to an Excel spreadsheet.
Dec 13 '07 #11
AccessIdiot
493 256MB
You store the name of the query in a field in your table (QueryName).
When your record is selected on the form, you execute code that calls :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenQuery(Me.QueryName, ...)
to see the results or :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet(Me.QueryName, ...)
to export the results to an Excel spreadsheet.
Thanks NeoPa, but I'm afraid I'm totally lost. I added a text field in the table that stores the name of the query for each question asked. But you know how you get auto hints when you start typing code in the VB builder? The name of my field didn't show up and when I type it in manually and run it I get an error that it isn't a property.

So I'm stuck. :-(
Dec 17 '07 #12
NeoPa
32,556 Expert Mod 16PB
If the field is called [QueryName] then you could have a ComboBox called [cboQueryName] which lists the queries from the [QueryName] field. [cboQueryName] would be what you need to execute.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet(Me.cboQueryName, ...)
Does that make more sense?
Dec 17 '07 #13
AccessIdiot
493 256MB
It totally does and I'm not sure why I'm having so much trouble. When I create the combo box it wants to show each row in a new record, instead of having all the values available on one drop down.

And when I try the code on an After Update event it tells me there is no method named Query_Name.
Dec 17 '07 #14
NeoPa
32,556 Expert Mod 16PB
It totally does and I'm not sure why I'm having so much trouble. When I create the combo box it wants to show each row in a new record, instead of having all the values available on one drop down.
I'm not really sure what you're trying to describe here I'm afraid.
And when I try the code on an After Update event it tells me there is no method named Query_Name.
I'm not sure where Query_Name came in. I assume it's either the field or the control, but without knowing it's hard to guide you.
However, to get the code in the right place, simply :
  1. Select the control in the form design.
  2. Open up the Properties pane if not already open.
  3. Go down to After Update and select [Event Procedure] (exactly that) from the dropdown there.
  4. Click on the elipsis (...) button immediately to the right.
This should take you to the code window with the stub of a (correctly named) procedure to fill up. Copy and paste your existing code into here.
Dec 18 '07 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: dterrors | last post by:
I figure before I go and write my summary of why you should go back to tables and only use CSS for fonts and colors and stuff, I ought to make sure I've got my facts right. So, please tell me how...
4
by: David | last post by:
A friend of mine has to export some data from his current access database into a CSV file to be imported into an accounting package. There are a few things that need to be done most of which I am...
0
by: Tim Marshall | last post by:
I just powered up A2003 and got the subject message and a progress bar. Whatever deed was intended was done, alas! I just updated to Win XP SR-2...would this have had anything to do with it or...
0
by: matungafriend | last post by:
Hi I am fresher what kind of questions are asked during .NET Interviews how should i prepare myself.I have just completed my course from my NIIT and looking forward for real job. I am doing the...
1
by: culley harrelson | last post by:
Is there any benefit to preparing a call to a pre-defined sql function or is the sql function already optimized? create temp table foo(col1 integer); insert into foo(col1) values(1); insert...
0
by: aprajitha | last post by:
Hi, What is the approach to be followed for preparing a fresh new installation kit for a server using the Microsoft Installer?
2
by: Jeff Rush | last post by:
Forrester Research is doing a study on dynamic languages and has asked that Python be represented. As advocacy coordinator I've volunteered to drive this, collecting answers from the community and...
3
by: samadams_2006 | last post by:
Hello, I'm interested in taking the following exam for an upcoming job. Exam 70-315: Developing and Implementing Web Applications with Microsoft Visual C#â„¢ .NET and Microsoft Visual Studio...
0
by: alipalengara | last post by:
Hi, I have crated a setup project with prerequisites (frmaework 3.5 and SQL express 2005) and i given some custom action for restoring the database. The Problem is that after installing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.