Setting focus on form

authorsami

Registered User.
Local time
Today, 10:25
Joined
Sep 24, 2003
Messages
10
If I create a very long form with several text boxes that list helpful information on the database, can I do the following:

From other forms using a "Help" Command button open the very long form and hae the focus jump to the area of the very long form that I want.

I tried using the following code but get an error stating "object doesn't support this property or method"

Here's the code:

Private Sub Command56_Click()
On Error GoTo Err_Command56_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmHelpPatient"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmHelpPatient!Label5.SetFocus



Exit_Command56_Click:
Exit Sub

Err_Command56_Click:
MsgBox Err.Description
Resume Exit_Command56_Click

End Sub


Thanks for the help.:confused:
 
OK, That sort of works. What is happening now is that the text box says #Name even though I typed in a name for it.

Also when it does set the focus to the text box, the box is at the bottom of my screen is there any way to make the text box go to the top of the screen?
 

Users who are viewing this thread

Back
Top Bottom