473,508 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DoCmd.openForm with goto???

17 New Member
hello guys,

i made a datasheet form with a selected number of fields. but you can doubleclick each record to go into the detailed record form. in the first two fields i put in this...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Field1_DblClick(Cancel As Integer)
  2.  
  3.     DoCmd.OpenForm "Detailed Form", , , "[Tdate] = #" & [Tdate] & "#"
  4.  
  5. End Sub
  6.  
that the form will be openend in exactly the correct record to show the detailed form. BUT this is a filter. so i cant cruise between the other records in the detailed form. is there any "docmd"-command which doesnt make a filter but opens just on the right record, so i can go up and down the records without the need of deleting the filter first?
Sep 23 '15 #1
2 1235
jforbes
1,107 Recognized Expert Top Contributor
The first example at https://msdn.microsoft.com/en-us/lib.../ff836583.aspx does what you are asking for. The one thing I would do different is instead of DoCmd.FindRecord, I would use Bookmarks and .FindFirst kind of like what is done here: http://allenbrowne.com/ser-03.html
Sep 23 '15 #2
rod4
17 New Member
I cant understand why i didnt find this "Openargs" myself! Thanks that you leed me the way. Here the Code i used to make it happen.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Field1_DblClick(Cancel As Integer)
  2.  
  3.     DoCmd.OpenForm "Detailed Form", , , , , , [Tdate]
  4.  
  5.     Dim strTDate As Date
  6.     strTDate = Forms![Detailed Form].OpenArgs
  7.     If Len(strTDate) > 0 Then
  8.         DoCmd.GoToControl "Tdate"
  9.         DoCmd.FindRecord strTDate, , True, , True, , True
  10.     End If
  11.  
  12. End Sub
I just put it in here to give others who google for it a nice and simple example!
Sep 24 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3936
by: Aravind | last post by:
Hi folks. I have 2 forms, frmMain and frmHistory. frmHistory has a field called Return. frmMain has a command button called "Due Today" (which will henceforth be called as DT), which opens...
6
4183
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo...
3
4486
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit...
15
3841
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
8
13186
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
2
6799
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data...
2
387
by: rturpyn | last post by:
I want to simply open a form, I don't want to limit the records returned. I'm using the code.... DoCmd.OpenForm "frm_GSG_Access_Rights", acFormDS, , When I enter something in the where...
2
12844
by: mark mestrom | last post by:
hi, i have this problem with OpenForm and the stLinkCriteria. I have the following code: Private Sub Knop22_Click() On Error GoTo Err_Knop22_Click Dim stDocName As String Dim...
1
2704
by: silen | last post by:
i am using Access2000. Currently i had a main form call "frmDownload" and sub form "fsubAdmmission". Under the fsubAdmmission, i do have another sub form "fsubHospital". Once i link my application to...
0
7225
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7495
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...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.