473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open form to a specific Record, but show all records??

I have a form with a subform in datasheet view and I have a event on
one of the fields in the subform, so that the user can double click it
and go to expanded information based on that field.

I'm using this code:
Private Sub SpecimenNum_DblClick(Cancel As Integer)
DoCmd.OpenForm "RDDevice", , , "[SpecimenNum] = '" & Me![SpecimenNum] &
"'"
End Sub

It works and goes to that record, but it filtered only to that specific
record. How can I go to that particular record and still be able to
browse the rest of the records.

I tried putting the DoCmd.ShowAllRecords command in that code above,
but then it doesn't go to me specific record, it goes to the first one.

Any info would be great.

Thanks,
Nick

Jun 9 '06 #1
2 11238
Find the record in the RecordsetClone of the form after you open it:
Dim strWhere As String
Dim rs As DAO.Recordset
strWhere = "[SpecimenNum] = '" & Me![SpecimenNum] & "'"
DoCmd.OpenForm "RDDevice"
With Forms!RDDevice
Set rs = .RecordsetClone
rs.FindFirst strWhere
If rs.NoMatch Then
MsgBox "Not found"
Else
.Bookmark = rs.Bookmark
End If
End With
Set rs= Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<nk****@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
I have a form with a subform in datasheet view and I have a event on
one of the fields in the subform, so that the user can double click it
and go to expanded information based on that field.

I'm using this code:
Private Sub SpecimenNum_DblClick(Cancel As Integer)
DoCmd.OpenForm "RDDevice", , , "[SpecimenNum] = '" & Me![SpecimenNum] &
"'"
End Sub

It works and goes to that record, but it filtered only to that specific
record. How can I go to that particular record and still be able to
browse the rest of the records.

I tried putting the DoCmd.ShowAllRecords command in that code above,
but then it doesn't go to me specific record, it goes to the first one.

Any info would be great.

Thanks,
Nick

Jun 9 '06 #2
Thanks Allen Works great!!

Jun 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Support4John | last post by:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7 I have a button on a Single Form that when pressed displays all the underlying records in the table in a Datasheet Form. For example, Northwind, Customer...
4
by: Dalan | last post by:
I presume that using an open recordset method is the preferred method of accomplishing what I'm trying to do. Of course, if there are other options that would work, feel free to share them. I...
3
by: Simone | last post by:
Hi All, I have a Find Record button setup in most of my forms in order to find a specific customer's details. I have just noticed today though that this search will only find the customer if it...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
3
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
3
by: kev | last post by:
Hi folks, I have a form for registration (frmRegistration) whereby i have two buttons. One is Save which saves record using the OnClick property. I used wizard to create the save button. The...
9
by: mtgrizzly52 | last post by:
Hi all, I've looked for an answer for this in lots of books, online in several discussion groups and have not found the answer which I feel may be very simple. What I want to do is have a...
5
by: BD | last post by:
I am coding with C# in Visual Studio 2005 for a database application residing on remote MS SQL Server 2005. What I want to do is open the same form but from 2 different places and only one...
3
by: DavidB | last post by:
I want to be able to go to a specific record on my form when I open it. The record I want to go to will be dynamic based on the value currently stored in a global variable. The global contains...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.