Rabu, 23 Januari 2019

[MS_AccessPros] Set Focus on the right record

 

Hi Everyone

I'm nearly there, it's the last little bit that's got me stumped / flummoxed (adjective of choice).

I have a continuous list form which shows Tasks against Customers.  On each row of the form there is a "Details" button which when clicked takes you to the Customer form like-

DoCmd.OpenForm "frmCstm", , , "[CstmID]=" & Me.CstmID, , , "Task" & CStr(Me.TaskID)


In the Form_Open section of frmCstm I have

----------------------------------------------------------------------------------------------

Private Sub Form_Open(Cancel As Integer)

Me.txtUsername = gstrUserName

If Left(Me.OpenArgs, 4) = "Task" Then       ' The first part = Task, the rest is the taskID

Me.PageTasks.SetFocus

End If

End Sub

----------------------------------------------------------------------------------------------

So far, so good.  The customer form is opened, and the focus is placed on the tab that shows tasks for the customer.  However, the focus is always at the top of the Task List.  How can I place the focus on the actual taskID that was passed in using OpenArgs?


Many thanks

Ray

__._,_.___

Posted by: rayfrew@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar