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