Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7073463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:55:58+00:00 2026-05-28T05:55:58+00:00

Can someone please help me on this find specific record Edit through MS access

  • 0

Can someone please help me on this find specific record Edit through MS access Forms

I have Frmfind form where I have one filed “ticket#” is a input text box
another filed was button “find”

When I enter ticket# which is primary key for my table. I need get the the specific ticket# record should be opened in FormEdit mode using VBA code…

So I have another form “frmEdit” of specific record which has to be called from frmfind -> specific input..

note: Ticket# is column in my table whcih it is primary to have the ticket#.

Code:

Option Compare Database

Private Sub find_Click()

If IsNull(Me.Text79) Or Me.Text79 = "" Then
            MsgBox "You must enter a Ticket #", vbOKOnly, "Required Data"
            Me.Text79.SetFocus
        Exit Sub
    End If

If [Ticket#] = Me.Text79.Value Then


MsgBox "Record found"

DoCmd.Close
DoCmd.OpenForm "frmEdit"

Else


MsgBox "not matching record"
Me.Text79.SetFocus

End If

End Sub

Private Sub Form_Open(cancel As Integer)
'On open set focus to text box
Me.Text79.SetFocus
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:55:58+00:00Added an answer on May 28, 2026 at 5:55 am

    You can use this code:

    Private Sub Command112_Click()
    
       Me.txtSeach.SetFocus
       On Error Resume Next
       DoCmd.OpenForm "frmEdit", , , "TicketNumber = '" & Nz(Me.text79, "") & "'"
    
    End Sub
    

    Note in above if TicketNumber is in fact a number column and not text, then remove the single quotes and use this:

       DoCmd.OpenForm "aa", , , "TicketNumber = " & Nz(Me.text79, "")
    

    Then for your message, just place that code in the forms on-open event that has a cancel:

    eg:

    Private Sub Form_Open(Cancel As Integer)
    
       If IsNull(Me!TicketNumberID) Then
          MsgBox "Please enter a valid Ticket #", vbOKOnly, "Required Data"
          Cancel = True
       End If
    
    End Sub
    

    The above assumes your search column is ticket number.
    You can also use dlookup(), or even dcount(). I think above is less code, but:

    Dim strWhere         As String
    
    strWhere = "TicketNumber = " & Me.text79
    
    If DCount("*", "tblBookings", strWhere) > 0 Then
       code for Record found goes here
    Else
       code reocrd not found code here
    End If
    

    So either way should suffice here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please help. I have been searching and encountered/modified this code I am
can someone please help me. why does this return an error: Dim stuff As
Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
Could someone please help explain why I can't get this to work? I properly
Please can someone help? I have the following code which uploads a file to
the following regexp is wrong - can someone please help to find all :-)
Can someone please help me find if there is any option selected I currently
Can someone please help me understand how I would write this. If i am
I am fighting this thing and cannot figure it out... can someone please help.
Can someone please help me out with printing the contents of an IFrame via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.