Kostas Konstantinidis
kost36 at otenet.gr
Tue Feb 13 13:04:23 CST 2007
Michael thank's for your response Labert, thank's you too ... well, with the DoCmd.OpenForm stdocname,,,,,acDialog the form opens but just on the first record and not on a new one and while I am trying to close the form after udate it hungs because with the next line DoCmd.GoToRecord acDataForm, stdocname, acNewRec it answers: he object 'myform' isn't open... am I doing something wrong? many thank's /kostas ----- Original Message ----- From: "Heenan, Lambert" <Lambert.Heenan at AIG.com> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Monday, February 12, 2007 10:40 PM Subject: Re: [AccessD] How to transfer text.. > You could to this... > > > Private Sub AM_DblClick(Cancel As Integer) > Dim poustia As String > Dim stdocname As String > > stdocname = "MT_basic_char" > If IsNull(num_mitroou) Then > > DoCmd.OpenForm stdocname,,,,,acDialog > > DoCmd.GoToRecord acDataForm, stdocname, acNewRec > > Me!AM = Forms(stdocname)!AM > DoCmd.Close acForm, stdocname > > else > poustia = Me!num_mitroou > DoCmd.OpenForm stdocname, , , "num_mitroou= " & poustia > End If > End Sub > > The trick to this is that you open stdocname in dialog mode. That causes > the > calling code to wait until either the opened form closes, or it is made > invisible. So if the MT_basic_char form's "Close" button is modified from > DoCmd.Close acFrom, Me.Name > To > Me.Visible = False > > Then when the user hits the close button the form will be hidden, the > calling code will resume execution, and it can pick up the value entered > with the line "Me!AM = Forms(stdocname)!AM", and then you code continues > by > actually closing the called form. > > > HTH > > Lambert > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas > Konstantinidis > Sent: Monday, February 12, 2007 2:43 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] How to transfer text.. > > > hi group, > On a double click on a form I use the follown: > > Private Sub AM_DblClick(Cancel As Integer) > Dim poustia As String > Dim stdocname As String > > stdocname = "MT_basic_char" > If IsNull(num_mitroou) Then > DoCmd.OpenForm stdocname > DoCmd.GoToRecord acDataForm, stdocname, acNewRec > else > poustia = Me!num_mitroou > DoCmd.OpenForm stdocname, , , "num_mitroou= " & poustia > End If > End Sub > > > what I want to do is after the new record update and closing the > stdocname > the text of AM's field to be tranfered to the AM field of the opened form > > Many thank's > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > >