Solved

MS Access - query a form question

Posted on 2011-02-15
4
305 Views
Last Modified: 2012-05-11
I have a form that I wanted a quick way to navigate to a specific record via a 'ticket number'

I came up with this to avoid having to write a query and involve a new form but is there a way to use a query called by a button to retrieve the matching record(s) and make the form navigate to the record(s)? I know that would be much quicker than this method.

Thanks for the help

DoCmd.GoToRecord acDataForm, "TicketForm", acGoTo, 1

Do Until TicketNumberEntry = TicketNumberBox

DoCmd.GoToRecord , , acNext

Loop
0
Comment
Question by:rinkydink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 400 total points
ID: 34903199


with me.recordsetclone
        .findfirst "[TicketNumberEntry]= " & TicketNumberBox
         if not .nomatch then
               me.bookmark=.bookmark
         else
             msgbox "record not found"
         end if
end with


if [TicketNumberEntry] is Text Data type
change this  line

      .findfirst "[TicketNumberEntry]= " & TicketNumberBox

with

      .findfirst "[TicketNumberEntry]= '" & TicketNumberBox &"'"



0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34903206
or you can filter the records in the form

me.filter="[TicketNumberEntry]= " & TicketNumberBox

me.filteron=true
0
 
LVL 44

Assisted Solution

by:GRayL
GRayL earned 100 total points
ID: 34912524
or you can use the OpenArgs property.  Press Alt+F11 to get to the VB Editor, in help enter OpenArgs
0
 
LVL 1

Author Closing Comment

by:rinkydink
ID: 34939913
Thanks guys!
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question