Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access - query a form question

Posted on 2011-02-15
4
Medium Priority
?
320 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 1600 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 400 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

721 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