Solved

Forms in Combo Box

Posted on 2012-04-03
8
365 Views
Last Modified: 2012-04-03
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
Comment
Question by:gigifarrow
  • 3
  • 3
  • 2
8 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37802632
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37802657
<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
 

Author Comment

by:gigifarrow
ID: 37802788
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 37802881
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37802974
...Make sure the DB is in a "trusted" location...
0
 

Author Comment

by:gigifarrow
ID: 37803017
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
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37803042
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
 

Author Comment

by:gigifarrow
ID: 37803113
Okay I wasnt using the name of my combo box. You are correct. My bad it works now thank you.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you how to use shortcut menus in the Access run-time environment.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question