Microsoft Access 2000 question

  interzone55 21:09 02 May 03
Locked

I've built a database with several reports created from queries.
The queries are simple Select queries eg listing all repairs carried out by an engineer between 01/04/03 & 30/04/03.
So when you select a query 3 boxes pop up one after another asking for the engineers name then start & finish dates.
Obviously the query only works if you spell the name correctly, so my life would be easier if I could have a combo box in the query pop-up that takes names from the staff table, but for the life of me I can't figure out how to put a combo box in the query pop-up.

Anyone got any ideas, short of me going & buying one of those huge Microsoft Press books that cost almost as much as the software?

  LastChip 22:39 02 May 03

click here;jsessionid=OLZHBTCQVLEALTQQACQSFEY?id=r00720030502gcn01.htm&rcode=

  LastChip 22:43 02 May 03

I've tried it, and if you open the page via the link, and then just copy and paste the remainder of the link in addition, you should arrive at the article.

  recap 11:36 03 May 03

Give this a try alan14:

Open the query in Design view. In the query design grid, right-click anywhere in the column of the field you want to change, and then click "Properties" on the shortcut menu. Click the "Lookup tab". In the DisplayControl property box, click Combo Box.

  interzone55 21:08 03 May 03

I think that may just do the trick, the database is at work, so I'll have to wait until Tuesday to check it, so I'll wait until then before I tick resolved.

BTW I had to join the website to view the content, I'm not going to get even more spam in my hotmail box am I?

  LastChip 21:44 03 May 03

It's a site for professionals.

Hope it helps you.

  interzone55 21:50 03 May 03

Guess that doesn't cover me then, I was printing some greetings cards this afternoon & forgot to take the leftover cards out of the printer, so the article has printed on 170gm shiny card!

  interzone55 21:52 08 May 03

Sorry, your response didn't help me in the way I wanted.
From what I can work out I need to set up a form & run the query from the form, but I can't figure out how to do this.
Unfortunately I don't have unrestricted web access at work, so I can't search around for an answer, I've had a dig around the help file & on Microsoft's website to no avail.
I'll have to go to the library on Saturday & borrow one of those huge Microsoft Office books.

Thanks for the help anyway, that site looks useful for future needs.

  recap 15:18 09 May 03

To my knowledge alan14, you cannot "set up a form & run the query from the form".

You can run a query from a Table, then from the query run a Form or Report. Once the query has been created you can create a Form, then you can set any field within that Form to become a Combo box or a list box.

  IanNiblock 16:00 09 May 03

A short answer to your question - yes it is possible to run a query from a form. The basic idea is that you would create a form with a combo box and 2 text boxes, the combo box would read data from the table containing engineers while the text boxes would be used to input the dates. It is then possible to reference these form controls from the query & to open the query by clicking on a button on the form.

To save explaining all the details of this solution I have prepared a quick example for you - click here should have a link on the page to download an access 2000 mdb file. All of the controls on the form were created using the wizard as this is the quickest way to create simple controls such as these so error handling is included if you look at the code.

If there are any more questions then let me know.

Regards

Ian.

  IanNiblock 16:06 09 May 03

I just re-read your original post - if you have a report that is based on the query then you can change the 2 lines of code behind the command button to:

stDocName = "MyReportName"
docmd.OpenReport stdocname, acViewPreview

You will see which lines I mean - they look very similar in the example I provided.

This thread is now locked and can not be replied to.

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

The Pantone Colour of the Year 2017 is Green

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…