473,662 Members | 2,622 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 1239
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.FindRecor d, 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
3977
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 frmHistory and filters it to display records where the value of Return is Null
6
4195
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 box if you want to add a new company. when you double click it brings up the new company form so you can enter the rest of the information besides just the name there. This all works. Here's what I want:
3
4510
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 the Search button, a query is run to search the Person table for a match. This produces a recordset (I am using ADO). If the RecordCount is zero, they get a No Match message. If the RecordCount is 1, a DoCmd.OpenForm is performed to open the...
15
3878
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 completing its work formB issues docmd.close ,Me docmd.openform "formA"
8
13204
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 shows all records, rather than going to the one I want. If I look at the form in design view, it shows 'SearchAssignmentID=1' (without quotes) as the filter in the properties list. frmSearchAssignments is bound to a query qrySearchAssignments....
2
6843
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 Dim srce As String, fstnme As String, lstnme As String, bidnum As String srce = Me.Source_Control If Not IsNull(Me.Text18) Then
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 ("Elist_Caption = 'GSG Model'") it does return my form with only 1 record. What am I missing? Thanks, -Turp
2
12863
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 stLinkCriteria As String stDocName = "ALAHistorieEdit"
1
2714
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 database A, when "frmDownload" loaded, it does successfully create "fsubAdmmission" object and i am able to assign "fsubAdmmission.form.recordsource". Once i link my application to database B, when "frmDownload" loaded, it failed to assign...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8546
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1993
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.