Discussion Locked

Access 97 Tough one!

0 helpful
13 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a database with names ID Numbers and box numbers. I want to create a form with 50 boxes. Each box will have a name on it. When you click on the box, a form with that person's information should pop up. Is this possible in Access97???

Thanks,
Alan

13 replies

by stillatit

Not particularly tough.

Create an array (hard code or load from a database, etc.) where you have in each row a "button text" and a "retrival key" entry.

Set up your primary form so that it has 50 buttons. On form activation, change the caption property on each button according to the array row corresponding to the button. Since you are doing this out of the array, it can be different each time, depending on how you are stuffing the array.

On click of any button, retrieve the record with the key in the appropriate row, and go to the next form.

Note that you can do this with buttons, fields, or labels. All you need is something which will respond to a "click" event.

Good luck.

by dr. dale

I'm not exactly sure what you mean by "box," but one thing you could do is have a command button for each name. On click, the command button would open a form with that person's information. Since there is a one-to-one correspondence between button and form, this would not be difficult at all. When you add a button to a form in Access 97, it brings up a wizard that will guide you through the process of linking the form to the button.

by bob sellman

You can take the brute force method and put 50 boxes or buttons on a form, each tied to bringing up a form with that person's info on it by tying code to each button (on click) or box (on got focus) to open the personInfo form with the filter that ID number = whatever is appropriate for the button or box activated.

But why not make it easier to use? Make a form that has an area to display the details. Include on the header or footer a combo box that lists the names available. When the combo box is updated, do the following:

' set filter on
me.filter = true
' set filter to select the one name
' selected in the combo box (me.cboFindName)
me.filter = "[ID] = " & me.cbofindname
' cboFindName should include the ID as the
' firstitem it selects (even if only the
' name is actually displayed in the combo
' box).

If you don't want the user to be able to change any of the data, make the person's information a separate form that is a subform on the main form. That way you can set the edit property of the main form to true while it is set to false (no edits) on the subform.

by gary_w

I would advise against 50 boxes on a form. You need a search area instead to lookup the person you want first. Much cleaner user interface.

Have a look at the sample databases that come with Access, lots of examples there.

Gary

by sankulpune

Hello Alan,

Why not consider the option of using a 'Find Record' combo.

The combo will contain the list of all names. You select the name and the related record will be displayed in the form.

You can use the 'Combo Box Wizard' available in the form design to create a 'Find Record' combo.

I would be glad to provide any more assistance you may need in this regard.

SanganakSakha,
Simple And Effective Solutions To Small Problems, No QuickFixes.

by dsa

You can create a form with 50 cmd buttons to represent your 50 boxes and assign ID numbers to each one of them. Create a Tmp table with one field and one record (ID). Create a table for the 50 persons with their information.

Create a pop-up form that is bound to a query that has the person table and the tmp table.

On the Click_Event of each box or cmd buttons, write the ID to tmp and open the pop up form.

It may not be efficient to have 50 boxes on a form but I assume that you have your reasons for doing this and the above steps will do exactly what you want.

This discussion is closed to new replies.