Solved

How open form if only one record exists in query?

Posted on 2013-11-14
2
423 Views
Last Modified: 2013-11-14
I'm using the onopen event of a form to determine if a second form should open right to a record.  

Here is my code which isn't anywhere near right I'm sure.  Can someone help?

Private Sub Form_Open(Cancel As Integer)

    Dim recordcount As Integer
    If recordcount = 1 Then
        DoCmd.OpenForm "frmIndividuals", acNormal, , "[IndividualID]=" & Me.txtIndividualID, acFormEdit, acWindowNormal
    End If

End Sub
0
Comment
Question by:SteveL13
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39649099
Try

Me.recordsetclone.movelast
If me.recordsetclone.recordcount =1 then
   Etc
End if
0
 

Author Comment

by:SteveL13
ID: 39649144
Perfect!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 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