Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SetFocus aber der Courser ist nicht dort

6 views
Skip to first unread message

Lupus Goebel

unread,
May 21, 2012, 11:47:10 AM5/21/12
to
tach auch,

WIN XP Prof mit SP 3 und Office 2007.

Der Code ist vorhanden
\\\
Dim rs As Recordset
With Forms!frmProjekteErfassen.Form
Set rs = .RecordsetClone
rs.FindFirst "IDKunden = " & strIDKunde
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End With
With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
' UFO unterfrmProjekte befindet sich auf Register 1 "Projekte"
Set rs = .RecordsetClone
rs.FindFirst "AuftragsNr = " & strIDProjekt
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
Set rs = Nothing
DoCmd.GoToControl "unterfrmProjekte"
.AuftragsNr.SetFocus
Debug.Print .ActiveControl.Name
DoCmd.GoToControl "AuftragsNr"
Debug.Print .ActiveControl.Name
End With
///

Der Code wird zwar einwandfrei ausgeführt, doch der Courser steht nicht
im Feld AuftragsNr.

\\\
Debug.Print .ActiveControl.Name
///
ergibt jedes mal "AuftragsNr"

Welche Dummheiten habe ich denn übersehen?


--
MfG - Lupus Goebel
Der Sumpf- Morasthobbybastler und Anfaenger mit
Wissensdurst (http://www.lupusdw.de http://foto.lupusdw.de)
Urlaub macht man in Irland: http://www.eaglesnest-bb.com/

Karl Donaubauer

unread,
May 21, 2012, 12:08:12 PM5/21/12
to
Lupus Goebel wrote:
> ...
> With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
> ' UFO unterfrmProjekte befindet sich auf Register 1 "Projekte"
> Set rs = .RecordsetClone
> rs.FindFirst "AuftragsNr = " & strIDProjekt
> If Not rs.NoMatch Then
> .Bookmark = rs.Bookmark
> End If
> Set rs = Nothing
> DoCmd.GoToControl "unterfrmProjekte"
> .AuftragsNr.SetFocus
> Debug.Print .ActiveControl.Name
> DoCmd.GoToControl "AuftragsNr"
> Debug.Print .ActiveControl.Name
> End With
>
> Der Code wird zwar einwandfrei ausgeführt, doch der Courser steht
> nicht im Feld AuftragsNr.
>
> Debug.Print .ActiveControl.Name
> ergibt jedes mal "AuftragsNr"
> ...

Schmeiß mal die GoToControls weg und versuch's mit
2 x SetFocus, zuerst fürs UFo, dann fürs Steuerelement:

With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
...
Me!unterfrmProjekte.SetFocus
!AuftragsNr.SetFocus
...

--
Servus
Karl
*********
Access-FAQ: http://www.donkarl.com


Lupus Goebel

unread,
May 21, 2012, 12:21:00 PM5/21/12
to
Erst mal danke..

Am 21.05.12 18:08 schrieb Karl Donaubauer:

>
> Schmeiß mal die GoToControls weg und versuch's mit
> 2 x SetFocus, zuerst fürs UFo, dann fürs Steuerelement:
>
> With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
> ....
> Me!unterfrmProjekte.SetFocus
> !AuftragsNr.SetFocus
> ....


Schlüsselwort ME mag er nicht und beginnen mit ! kennt er das
angesprochene Feld nicht.

Hier keine Fehlermeldung, aber Ziel auch nicht erreicht.

\\\
Forms![frmProjekteErfassen]!unterfrmProjekte.SetFocus
Debug.Print "3:", .ActiveControl.Name
!AuftragsNr.SetFocus
Debug.Print "4:", .ActiveControl.Name
///

Winfried Sonntag

unread,
May 21, 2012, 2:04:16 PM5/21/12
to
Am 21.05.2012 schrieb Lupus Goebel:


> With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
> ' UFO unterfrmProjekte befindet sich auf Register 1 "Projekte"
> Set rs = .RecordsetClone
> rs.FindFirst "AuftragsNr = " & strIDProjekt
> If Not rs.NoMatch Then
> .Bookmark = rs.Bookmark
> End If
> Set rs = Nothing
> DoCmd.GoToControl "unterfrmProjekte"
> .AuftragsNr.SetFocus
> Debug.Print .ActiveControl.Name
> DoCmd.GoToControl "AuftragsNr"
> Debug.Print .ActiveControl.Name
> End With
> ///
>
> Der Code wird zwar einwandfrei ausgeführt, doch der Courser steht nicht
> im Feld AuftragsNr.
>
> \\\
> Debug.Print .ActiveControl.Name
> ///
> ergibt jedes mal "AuftragsNr"

Me!Unterformular.SetFocus
Me!Unterformular!NeuesProdukt.SetFocus

Servus
Winfried
--
Connect2WSUS: http://www.grurili.de/tools/Connect2WSUS.exe
Community Forums NNTP Bridge: http://communitybridge.codeplex.com/
Access-FAQ: http://www.donkarl.com/AccessFAQ.htm
Access-Stammtisch: http://www.access-muenchen.de

Lupus Goebel

unread,
May 21, 2012, 3:35:14 PM5/21/12
to
Abend,

Am 21.05.12 20:04 schrieb Winfried Sonntag:

> Me!Unterformular.SetFocus
> Me!Unterformular!NeuesProdukt.SetFocus


Also
\\\
With Forms![frmProjekteErfassen]!unterfrmProjekte.Form
' UFO unterfrmProjekte befindet sich auf Register 1 "Projekte"
Set rs = .RecordsetClone
rs.FindFirst "AuftragsNr = " & strIDProjekt
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
Set rs = Nothing
Forms![frmProjekteErfassen]![unterfrmProjekte].SetFocus
Forms![frmProjekteErfassen]![unterfrmProjekte].Form!AuftragsNr.SetFocus
End With
//

Hat an meinem Problem nix geändert.

hat das evtl. damit was zu tun, das die UFO's in unterschiedliche
Register sind? Kann ich mir jetzt aber nicht vorstellen.
denn das <Debug.Print .ActiveControl.Name> gibt den richtigen Namen aus.
0 new messages