[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

Forms in Combo Box

I have a combo box that has forms displayed in them. The problem I have is when I select one of the forms it will not open Here is the code that I have so far:

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

following settings in the Combo box:
Column Count 1
Bound Column 1
Column Widths 2"
0
gigifarrow
Asked:
gigifarrow
  • 3
  • 3
  • 2
1 Solution
 
Dale FyeCommented:
Then you need some code in the AfterUpdate event of the combo box.  Something like:

Private Sub cbo_Forms_AfterUpdate

    docmd.openform me.cbo_Forms

End Sub
0
 
Jeffrey CoachmanMIS LiasonCommented:
<No Points wanted>

Or put that same code on the click event of a button...
(in case the user selected the wrong form from the combobox and it opens)
0
 
gigifarrowAuthor Commented:
I put the same code in afterupdate and it didnt work. I get a syntax error that all it tells me.
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32768))
ORDER BY MSysObjects.Name;

When I put the other code in it doesnt give me any error. It just dont work.
Private Sub cbo_Forms_AfterUpdate

    docmd.openform me.cbo_Forms

End Sub
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Dale FyeCommented:
so, what is the name of your combo box?

I assume that the column Count and Bound column properties of the combo box are set to 1.

What does your code look like (exactly)

did you open the form in design view, click on the combo, then display the properties, go to the events tab

Check out my sample.Forms.mdb
0
 
Jeffrey CoachmanMIS LiasonCommented:
...Make sure the DB is in a "trusted" location...
0
 
gigifarrowAuthor Commented:
When I use the following command:

DoCmd.OpenForm Me.cbo_Form
    Me.Visible = False
I get an error Where it says Me.cbo_Form ,"data type not found".
0
 
Dale FyeCommented:
Is that error occuring in your form, or in mine?

I will ask this again, WHAT IS THE NAME OF YOUR COMBO BOX?

"cbo_Form" is what I named mine, you need to refer to your combo box (it might be combo12 or something like that).  If it is "combo12", then the code would look like:

docmd.openform me.combo12
0
 
gigifarrowAuthor Commented:
Okay I wasnt using the name of my combo box. You are correct. My bad it works now thank you.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now