Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focus on another form

Status
Not open for further replies.

jwigh

Technical User
May 27, 2002
23
SE
When I open a form fAccepted should under some conditions another form fChanges open. With access 2000 I use this code.

Private Sub Form_Open(Cancel As Integer)
DoCmd.MoveSize 0, 0, 15300, 10000
If DMax("RevDate", "tVersion") >= DLookup("LastAccess", "tUsers", "User='" & Forms!fInloggning!tbUser & "'") Then
DoCmd.OpenForm "fChanges"
End If
End Sub


If the condititon is meet, fChanges opens but behind fAccepted. I have tried Forms!fChanges!btOk.SetFocus after DoCmd.OpenForm... without any difference.

I have done things like this before without any problems.
 
Have you tried Me.btOk.SetFocus on the Form_Open event of fChanges form?

See if that works.

Dave
 
Hi!

Just guessing here, but is the current form (fAccepted) either opened with the acDialog argument, or does it have it's modal/popup properties set to yes?

If so, you might get a better result opening the changes form with acdialog.

[tt]DoCmd.OpenForm "fChanges",,,,,acDialog[/tt]

HTH Roy-Vidar
 
The Pop-up property for the form fChanges were set to No. When changed to Yes it worked ok.

Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top