add form controls

jrmywvr

Registered User.
Local time
Today, 00:32
Joined
Jan 8, 2003
Messages
10
I have a query that is based on a table with a list of employees. The criteria for the query is "active" in the [status] field. I then have a form that is based on this query with a check box for each employee listed.

What I would like to do is have the form change when the query changes. I figured the best way to do this would be to have a blank form and add the check boxes from code each time the form is opened.

Can I create new controls from code?

_______________
I'm using Access 97 in Windows 98
JrmyWvr
 
I suggest you look at having your form open in "Continuous Forms" mode if you are trying to show a form with all the employees in, say, a query. With the Properties window open, look on the Format tab, Default View. On the form, put the check box and maybe the employee name beside each other. Reduce the Detail section of the form so it just encloses the check box and name, and see if it doesn't give you what you want.

Jim
 
Yeah, it looks like I'm going to have to try to make that work. I found the Add Method for the Controls Object in Visual Basic 6 but that isn't available in Access 97.

The only problem with using continuous forms is that my list is big enough that I would like to have it in more than one column.

Thanks for the help.
 
If your list is huge, consider having your main form include an alphabet where users select a letter, and have a continuous-form subform that only displays names beginning with the the selected letter. This might be kind of a challenging programming task, but there're probably examples out on the web. As a start you could have a combo box where the user selects a letter, and in the subform record source add something like

"WHERE Left([LastName],1) = " & Forms!frmThisForm!cboLetter

Another idea would be to display the whole list, have the combo box as above, and when it changes, do a FindRecord to scroll to the names beginning with the selected letter.

HTH,
Jim
 

Users who are viewing this thread

Back
Top Bottom