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 / January 2005

Tip: Looking for answers? Try searching our database.

open a form from selected item of combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
reservedbcreater - 25 Jan 2005 16:28 GMT
i want to select a value from my combo box and have it open the form
corresponding to that value.....ie combo box has 7 values....each is a
reserve(indian settlement) name, each reserve has its own form. so i pick
one of the reserves from the drop down combo box and then click the go
button i created, and its supposed to open the correct form............

here is my psuedo code for the go button click event:

if cbo.selecteditem = sweet grass then
docmd.openform sweet grass

elseif cbo.selecteditem = little pine then
docmd.openform little pine

etc..

end if
Steve Conway - 25 Jan 2005 16:52 GMT
>i want to select a value from my combo box and have it open the form
> corresponding to that value.....ie combo box has 7 values....each is a
[quoted text clipped - 13 lines]
>
> end if

You can just place
If Not IsNull(cbo) Then DoCmd.OpenForm cbo

in your button's click event. This is assuming "cbo" is the name of your
combo control and the values are the names of your forms.

HTH
Steve C
reservedbcreater - 25 Jan 2005 17:34 GMT
first of all i dunno what the name of my combo box is? how do i name
it.......also....the combo box selection are jsut the reserve names...the
forsm have sligthy different names. ie Sweet Grass: Water
anonymous@discussions.microsoft.com - 25 Jan 2005 18:01 GMT
in design mode, right click the combo box then click
properties. the name will be at the top. it will probably
be something like combobox1. you can rename it. I usually
rename all my controls to a name like what goes in them.
like a text box for name become txtname. i usually start
combobox name with cb. renameing control like this
sometimes makes it easier later when you aare writing code.

>-----Original Message-----
>first of all i dunno what the name of my combo box is? how do i name
>it.......also....the combo box selection are jsut the reserve names...the
>forsm have sligthy different names. ie Sweet Grass: Water
>
>.
reservedbcreater - 25 Jan 2005 17:28 GMT
ur recomendation didnt work? is ther esomeway to do it using my way?

here is my psuedo code for the go button click event:

if cbo.selecteditem = sweet grass then
docmd.openform sweet grass

elseif cbo.selecteditem = little pine then
docmd.openform little pine

etc..

end if

(im used to VB.Net)
reservedbcreater - 25 Jan 2005 19:12 GMT
thank u it worked
 
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.