How to get around making 23 buttons ?

  • Thread starter Thread starter Debora Hollander
  • Start date Start date
D

Debora Hollander

I have 23 forms that people can choose from to start
entering data. Is it possible to create a 'starting form'
which contains a drop-down list with the names of these 23
forms, which people can choose from, and then click a
button to go to that specific form ? Or is there some
other way to get the same result ?
I was thinking of placing a button per form, but I think
23 buttons is not very user-friendly...

Who can help me out here ? Thank you !

Debora Hollander
 
To load the list of forms into a combo box, set its RowSource property to:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32768) AND ([Name] Not Like '~*'))
ORDER BY MsysObjects.Name;

You can then use the AfterUpdate event of the combo to OpenForm.
 
Hi,
You can use this query to fill a combo or list box with all your forms:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32768));

MSysObjects is a system table that contains meta data. you can view it if you
select Show System Objects from the Tools->Options menu

This code placed in the AfterUpdate of the combo would open the form:

DoCmd.OpenForm Me.yourCombo
 
How would an after update procedure openform look like?

hermie
Allen Browne said:
To load the list of forms into a combo box, set its RowSource property to:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32768) AND ([Name] Not Like '~*'))
ORDER BY MsysObjects.Name;

You can then use the AfterUpdate event of the combo to OpenForm.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Debora Hollander said:
I have 23 forms that people can choose from to start
entering data. Is it possible to create a 'starting form'
which contains a drop-down list with the names of these 23
forms, which people can choose from, and then click a
button to go to that specific form ? Or is there some
other way to get the same result ?
I was thinking of placing a button per form, but I think
23 buttons is not very user-friendly...

Who can help me out here ? Thank you !

Debora Hollander
 
Thanks, it works ! BUT: I have more forms than I need to
include (26, and I only want 23 in the combo list). I
think a small adaptation is needed, but which ?

Debora.
-----Original Message-----
How would an after update procedure openform look like?

hermie
To load the list of forms into a combo box, set its RowSource property to:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32768) AND ([Name] Not Like '~*'))
ORDER BY MsysObjects.Name;

You can then use the AfterUpdate event of the combo to OpenForm.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Debora Hollander"


.
 
If you want to list only some of the forms, you could save their names in a
table.
Alternatively, change the Row Source Type of the combo to Value List, and
enter the names of the forms, e.g.:
"Form1";"Form2";"MyOtherForm"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Debora Hollander said:
Thanks, it works ! BUT: I have more forms than I need to
include (26, and I only want 23 in the combo list). I
think a small adaptation is needed, but which ?

Debora.
-----Original Message-----
How would an after update procedure openform look like?

hermie
To load the list of forms into a combo box, set its RowSource property to:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32768) AND ([Name] Not Like '~*'))
ORDER BY MsysObjects.Name;

You can then use the AfterUpdate event of the combo to OpenForm.


"Debora Hollander"
I have 23 forms that people can choose from to start
entering data. Is it possible to create a 'starting form'
which contains a drop-down list with the names of these 23
forms, which people can choose from, and then click a
button to go to that specific form ? Or is there some
other way to get the same result ?
I was thinking of placing a button per form, but I think
23 buttons is not very user-friendly...

Who can help me out here ? Thank you !

Debora Hollander
 
This example assumes the combo is named "cboForm":

Private Sub cboForm_AfterUpdate
If Not IsNull(Me.cboForm) Then
DoCmd.OpenForm Me.cboForm
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

hermie said:
How would an after update procedure openform look like?

hermie
Allen Browne said:
To load the list of forms into a combo box, set its RowSource property
to:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32768) AND ([Name] Not Like '~*'))
ORDER BY MsysObjects.Name;

You can then use the AfterUpdate event of the combo to OpenForm.


Debora Hollander said:
I have 23 forms that people can choose from to start
entering data. Is it possible to create a 'starting form'
which contains a drop-down list with the names of these 23
forms, which people can choose from, and then click a
button to go to that specific form ? Or is there some
other way to get the same result ?
I was thinking of placing a button per form, but I think
23 buttons is not very user-friendly...

Who can help me out here ? Thank you !

Debora Hollander
 
Back
Top