Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / September 2007

Tip: Looking for answers? Try searching our database.

ComboBox / Command Button / Form Help!!!!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 20 Sep 2007 16:00 GMT
I have a form with a combo box with a list of names (queried from a
table) and a command button I want to be able to select a name from
the combo box, then click (or press "enter" on) a command button ,
which will open a seperate form that corresponds with that individual
name.   There are 4 names and 1 unique form for each name.  Any
suggestions on how I might be able to achieve this? Thank you
Mr B - 20 Sep 2007 17:04 GMT
Chris,

In the Click event of the command button, try using a Select Case statement.

Select Case Me.NameOfComboBox
Case "One of the Names"
    'open the correct form
    docmd.openform "FormName"
Case "Another one of the Names"
    'open the correct form
    docmd.openform "FormName"
'repeate each case statement for each name, opening the correct form

End Select

Keep in mind that the code above does nothing else but open the desired form
based on the selection made from the combo box.

Signature

HTH

Mr B
askdoctoraccess dot com

> I have a form with a combo box with a list of names (queried from a
> table) and a command button I want to be able to select a name from
> the combo box, then click (or press "enter" on) a command button ,
> which will open a seperate form that corresponds with that individual
> name.   There are 4 names and 1 unique form for each name.  Any
> suggestions on how I might be able to achieve this? Thank you
Chris - 20 Sep 2007 19:03 GMT
> Chris,
>
[quoted text clipped - 28 lines]
>
> - Show quoted text -

Thanks you Mr B for a very prompt and correct response.  This code did
exactly what I was looking for.

Thanks Again!
Mr B - 20 Sep 2007 20:28 GMT
Your are quite welcome.  Glad to help.

Good luck on your Access project.
Signature

HTH

Mr B
askdoctoraccess dot com

> > Chris,
> >
[quoted text clipped - 33 lines]
>
> Thanks Again!
mcescher - 20 Sep 2007 22:21 GMT
>I have a form with a combo box with a list of names (queried from a
>table) and a command button I want to be able to select a name from
>the combo box, then click (or press "enter" on) a command button ,
>which will open a seperate form that corresponds with that individual
>name.   There are 4 names and 1 unique form for each name.  Any
>suggestions on how I might be able to achieve this? Thank you

Add another column to your table with the form name, and then add the
column to your combo box.  (Width = 0)

Private Sub cmdOpenForm_Click()
 DoCmd.OpenForm Me.NameOfComboBox.Column(1)
End Sub

Then, as you add more forms, you can just update the table to open
those forms.
HTH,
Chris M.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.