By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,842 Members | 2,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,842 IT Pros & Developers. It's quick & easy.

how to open one form from multiple forms using combo box in access 2007

P: 1
i have one main form in which i insert combo box in which i put name of the forms manually. now on selecting any particluar form name from combo box i want to open the form containg that name without having master child relations . pl let me know coding to allow opening of form on the basis of name selected from cobo box value(form Name)with hiding the main form simultiniously
Jan 2 '19 #1
Share this Question
Share on Google+
4 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,158
prabhatjian,

Welcome to Bytes!

Your problem is relatively simple:

Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenForm(FormName:=Me.ComboBoxName)
  2. Me.Visible = False
Hope this hepps.
Jan 2 '19 #2

NeoPa
Expert Mod 15k+
P: 31,306
I think you need a little more than that Twinny :
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComboBoxName_AfterUpdate()
  2.     With Me
  3.         Call DoCmd.OpenForm(FormName:=.ComboBoxName)
  4.         .Visible = False
  5.     End With
  6. End Sub
The sub declaration line is relevant and important in this case I would say.
Jan 3 '19 #3

twinnyfo
Expert Mod 2.5K+
P: 3,158
@NeoPa
True. But I did not want to presume on when OP wanted the code to execute.

Your solution is certainly more elegant. Iím just a bum from the slum!

;-)
Jan 3 '19 #4

NeoPa
Expert Mod 15k+
P: 31,306
I was going by the wording in the OP.
PrabhatJain:
now on selecting any particluar form name from combo box i want to open the form containg that name
I understand it wasn't 100% clear ;-)
Jan 3 '19 #5

Post your reply

Sign in to post your reply or Sign up for a free account.