Results 1 to 3 of 3
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,371

    Auto Scroll To Record From Search String


    Hi Guy's, I have looked a couple of things on this but unsure if something is possible ?

    So the following piece of code (not fully pasted) as there is a lot, however, based on what is pasted, this opens up the correct Tab Page from Main page, adds in the correct week dates etc based on strSL

    Is there a method where it can highlight the specific record ie select so the record highlights blue as if you had selected it manually ?

    The records are displayed on a Form in Datasheet view

    IDEALLY TAKE OUT PART OF MSGBOX "Scroll To", everything works fine but I suppose my question is, can I auto scroll and/or highlight and/or select the record based on strSL

    Hoping there is enough here to advise ?

    Code:
    varStatusOpt = InputBox(strSL & " Is In Deliveries For Week: " & Format(dtDate, "dddd-dd-mmm-yyyy") & vbCrLf & vbCrLf & _                    "What Do You Want To Do Next ?" & vbCrLf & vbCrLf & _
                            vbTab & "Leave Blank to Abort" & vbCrLf & vbCrLf & _
                            vbTab & Chr(149) & " 1 " & Chr(149) & " To Go To Record" & vbCrLf & vbCrLf & _
                            vbTab & Chr(149) & " 2 " & Chr(149) & " To Remove From Assign And Re-Plan", "RECORD FOUND")
                    
                    Select Case varStatusOpt
                                
                        Case ""
                                
                            Exit Sub
                                
                        Case Is = "1"
                            
                        MsgBox ("Opening Assigned Deliveries For " & Format(dtDate, "dddd-dd-mmm-yyyy") & vbCrLf & vbCrLf & _
                            "Scroll To: " & strDelTo & vbCrLf & vbCrLf & _
                            strSL), vbInformation + vbOKOnly, "GOING TO RECORD NOW"
                                                            
                            Forms!frmMainMenu.tbcMain = 3
                            
                            Forms!frmMainMenu!frmIndex3!cboShipmentDateIndex3 = DLookup("ShipmentDate", "tblEdit", "[SONumber] = '" & strSL & "'")
                            Forms!frmMainMenu!frmIndex3!txtDelDate = dtDate
                            Forms!frmMainMenu!frmIndex3DS.Requery
                            
                    End Select

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,159
    The normal method is to use a recordset clone to search for the thing, and if found set the form bookmark to the clones bookmark.
    Very similar to the process here: http://baldyweb.com/Requery.htm
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,371
    Thanks Minty, will check this out and test

    Kindest

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-15-2022, 01:18 AM
  2. Replies: 7
    Last Post: 09-02-2016, 03:47 PM
  3. Replies: 3
    Last Post: 12-02-2014, 03:10 PM
  4. Replies: 5
    Last Post: 08-25-2014, 05:33 PM
  5. Auto Scroll in a Form
    By delliott777 in forum Forms
    Replies: 0
    Last Post: 05-31-2008, 07:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums