|
|
I am trying to do something that seems like it should be simple, but i can't get it right. I have a popup form for users to enter or edit organizations (frmOrganizations) that can be opened from various forms in the database by double clicking on a control (cboOrganization). I want to be able to send the name of the form in the openargs when they double click so that when they finish entering or editing the organization, the control (cboOrganization) can be populated with the value they entered or requeried. I thought i could do it this way rather than having to look for the originating form using currentproject.allforms. Any ideas?
Thanks, Jenn
|
|
On Fri, 12 Dec 2008 09:48:19 -0800 (PST), JEM <Jenn[ at ]JEMConsulting.org> wrote:
DoCmd.OpenForm "frmOrganizations", OpenArgs:=Me.Name
-Tom. Microsoft Access MVP
[Quoted Text] >I am trying to do something that seems like it should be simple, but i >can't get it right. I have a popup form for users to enter or edit >organizations (frmOrganizations) that can be opened from various forms >in the database by double clicking on a control (cboOrganization). I >want to be able to send the name of the form in the openargs when they >double click so that when they finish entering or editing the >organization, the control (cboOrganization) can be populated with the >value they entered or requeried. I thought i could do it this way >rather than having to look for the originating form using >currentproject.allforms. Any ideas? > >Thanks, >Jenn
|
|
On Dec 12, 10:24 pm, Tom van Stiphout <tom7744.no.s...[ at ]cox.net> wrote:
[Quoted Text] > On Fri, 12 Dec 2008 09:48:19 -0800 (PST), JEM <J...[ at ]JEMConsulting.org> > wrote: > > DoCmd.OpenForm "frmOrganizations", OpenArgs:=Me.Name > > -Tom. > Microsoft Access MVP > > > > >I am trying to do something that seems like it should be simple, but i > >can't get it right. I have a popup form for users to enter or edit > >organizations (frmOrganizations) that can be opened from various forms > >in the database by double clicking on a control (cboOrganization). I > >want to be able to send the name of the form in the openargs when they > >double click so that when they finish entering or editing the > >organization, the control (cboOrganization) can be populated with the > >value they entered or requeried. I thought i could do it this way > >rather than having to look for the originating form using > >currentproject.allforms. Any ideas? > > >Thanks, > >Jenn- Hide quoted text - > > - Show quoted text -
Thanks, i got that part, the part that i can't figure out how to do is to requery the control on the form based on what the value of the openargs is. You can't do Forms!me.openargs!cboOrganization.Requery. I also tried:
Dim frm As Form Set frmname = me.openargs forms!frmname!cboOrganization.requery
Doesn't work either. Any ideas?
|
|
On Mon, 15 Dec 2008 06:59:46 -0800 (PST), JEM <Jenn[ at ]JEMConsulting.org> wrote:
Forms(Me.OpenArgs)!cboOrganization.requery
-Tom. Microsoft Access MVP
<clip>
[Quoted Text] > >Thanks, i got that part, the part that i can't figure out how to do is >to requery the control on the form based on what the value of the >openargs is. You can't do Forms!me.openargs!cboOrganization.Requery. >I also tried: > >Dim frm As Form >Set frmname = me.openargs >forms!frmname!cboOrganization.requery > >Doesn't work either. Any ideas?
|
|
"JEM" <Jenn[ at ]JEMConsulting.org> wrote in message news:bd181e23-5fc5-411a-a533-cb9dde785d43[ at ]n33g2000pri.googlegroups.com... On Dec 12, 10:24 pm, Tom van Stiphout <tom7744.no.s...[ at ]cox.net> wrote:
[Quoted Text] > On Fri, 12 Dec 2008 09:48:19 -0800 (PST), JEM <J...[ at ]JEMConsulting.org> > wrote: > > DoCmd.OpenForm "frmOrganizations", OpenArgs:=Me.Name > > -Tom. > Microsoft Access MVP > > > >I am trying to do something that seems like it should be simple, but i > >can't get it right. I have a popup form for users to enter or edit > >organizations (frmOrganizations) that can be opened from various forms > >in the database by double clicking on a control (cboOrganization). I > >want to be able to send the name of the form in the openargs when they > >double click so that when they finish entering or editing the > >organization, the control (cboOrganization) can be populated with the > >value they entered or requeried. I thought i could do it this way > >rather than having to look for the originating form using > >currentproject.allforms. Any ideas? > > >Thanks, > >Jenn- Hide quoted text - > > - Show quoted text -
> Thanks, i got that part, the part that i can't figure out how to do is > to requery the control on the form based on what the value of the > openargs is. You can't do Forms!me.openargs!cboOrganization.Requery. > I also tried: > > Dim frm As Form > Set frmname = me.openargs > forms!frmname!cboOrganization.requery > > Doesn't work either. Any ideas?
Me.OpenArgs is a string, not a form; so as Tom has said, you must write something like:
Dim frm As Form Set frmname = Forms (me.openargs) frm!cboOrganization.requery
You could also add a public variable to your frmOrganizations form and populates it with the current form (untested):
' On the frmOrganizations form: Public frm As Form
' When opening the frmOrganizations form from another form: DoCmd.OpenForm "frmOrganizations", acNormal Set Forms("frmOrganizations").frm = Me ...
When you are finished with it, you can reset the value of frm to Null in order to catch any glitch.
-- Sylvain Lafontaine, ing. MVP - Technologies Virtual-PC E-mail: sylvain aei ca (fill the blanks, no spam please)
|
|
|