[AccessD] How to transfer text..

Heenan, Lambert Lambert.Heenan at AIG.com
Tue Feb 13 13:36:44 CST 2007


Re "the object 'myform' isn't open... "  the code behind the form's "Close"
button should *not* close the form. Instead it should say "Me.Visible =
False", which hides the from and then allows the calling code to continue
running...

    Me!AM = Forms(stdocname)!AM ' <- gets the value from the hidden, but
still loaded form
    DoCmd.Close acForm, stdocname' <- closes the hidden form

Re opening on the wrong record. Change the open form code to

DoCmd.OpenForm stdocname, , , "num_mitroou= " & poustia,,acDialog

That line now includes the where condition that selects the correct record.

Lambert


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas
Konstantinidis
Sent: Tuesday, February 13, 2007 2:04 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to transfer text..


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
>
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list