Thanks, I will try it tomorrow as it's already 3 a.m. now in the morning. Good night !
Regards Kiang --- In [email protected], "John Viescas" <[EMAIL PROTECTED]> wrote: > Kiang- > > You should never have two forms open editing the same data. I don't > understand your problem. To close SHRINKAGE and BUDGET and open SCHEDULE > and EXPENDITURE, the code would look like: > > DoCmd.Close acForm, "SHRINKAGE" > DoCmd.Close acForm, "BUDGET" > DoCmd.OpenForm "SCHEDULE" > DoCmd.OpenForm "EXPENDITURE" > > .. all in one code module. > > John Viescas, author > "Building Microsoft Access Applications" > "Microsoft Office Access 2003 Inside Out" > "Running Microsoft Access 2000" > "SQL Queries for Mere Mortals" > http://www.viescas.com/ > > > -----Original Message----- > > From: [email protected] > > [mailto:[EMAIL PROTECTED] On Behalf Of yong_yong6666 > > Sent: Wednesday, August 03, 2005 1:47 PM > > To: [email protected] > > Subject: [ms_access] Re: Code to close & open various form > > simultaneously > > > > > > Hi John, > > > > I have no problem to open one form and close another form at the same > > time, but having difficulties to open or close more than one form. > > The reason to control other forms (closing and opening) with the > > working form is b'cos of data updating. If I don't close and open the > > other related forms, the data linked to those tables or forms will > > not be updated (have tried even with Refresh function in vain). > > > > Regards > > Kiang > > > > --- In [email protected], "John Viescas" <[EMAIL PROTECTED]> wrote: > > > Kiang- > > > > > > You must execute one DoCmd.OpenForm for each form you want to > > open. Do > > > close a form, use: > > > > > > DoCmd.Close acForm, "<name of form here>" > > > > > > John Viescas, author > > > "Building Microsoft Access Applications" > > > "Microsoft Office Access 2003 Inside Out" > > > "Running Microsoft Access 2000" > > > "SQL Queries for Mere Mortals" > > > http://www.viescas.com/ > > > > > > > -----Original Message----- > > > > From: [email protected] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of yong_yong6666 > > > > Sent: Wednesday, August 03, 2005 12:34 PM > > > > To: [email protected] > > > > Subject: [ms_access] Code to close & open various form > > simultaneously > > > > > > > > > > > > Typyically, the code generated by MS Access will appear as below > > on > > > > command button to open form on click : > > > > ============================================== > > > > Private Sub Command14_Click() > > > > On Error GoTo Err_Command1444_Click > > > > > > > > Dim stDocName As String > > > > Dim stLinkCriteria As String > > > > > > > > stDocName = "SCHEDULE" > > > > > > > > stLinkCriteria = "[ScheduleID]=" & Me![scheduleID] > > > > DoCmd.OpenForm stDocName, , , stLinkCriteria > > > > > > > > Exit_Command14_Click: > > > > Exit Sub > > > > > > > > Err_Command14_Click: > > > > MsgBox Err.Description > > > > Resume Exit_Command14_Click > > > > > > > > End Sub > > > > ================================================= > > > > My question : > > > > > > > > Can "stDocName" contain several forms ? For example, > > > > stDocName = "SCHEDULE" > > > > stDocName = "EXPENDITURE" > > > > stDocName = "SHRINKAGE" > > > > stDocName = "BUDGET" > > > > Ultimately, on click, will all the 4 forms open up > > simultaneously ? > > > > > > > > What if, on click, I need > > > > "SCHEDULE" & "EXPENDITURE" to be opened; and > > > > "SHRINKAGE" & "BUDGET"to be closed ? > > > > How could I insert Docmd.close for the the files to be closed ? > > > > > > > > Many thanks for the help rendered. > > > > > > > > Regards > > > > Kiang > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------ Yahoo! Groups Sponsor > > > > --------------------~--> > > > > <font face=arial size=-1><a > > > > href="http://us.ard.yahoo.com/SIG=12hpmhdpm/M=362131.6882499.7 > > > > 825260.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=1123097702 > > > > /A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org > > > > ">Get Bzzzy! (real tools to help you find a job) Welcome to > > > > the Sweet Life - brought to you by One Economy</a>.</font> > > > > -------------------------------------------------------------- > > > > ------~-> > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------ Yahoo! Groups Sponsor > > --------------------~--> > > <font face=arial size=-1><a > > href="http://us.ard.yahoo.com/SIG=12hkq0dpl/M=362329.6886308.7 > > 839368.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=1123102041 > > /A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?p > > age_id=1992 > > ">Fair play? Video games influencing politics. Click and talk > > back!</a>.</font> > > -------------------------------------------------------------- > > ------~-> > > > > > > Yahoo! Groups Links > > > > > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hv161bb/M=362131.6882499.7825260.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=1123103294/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org ">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
