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

Home Posts Topics Members FAQ

Open form that shows current record

5 New Member
I am new at Access, databases, AND posting threads (sorry). I have a subform that is a continuous form based on a tabular query. I enter a particular serial # (on the main form) and the subform shows me one to several forms that are related to that serial #. Each form shows only a few select fields of that particular record. I would like to be able to click a Veiw button (which is a cmd button on this subform) to bring up yet another form that would show ALL of the fields of that ONE SAME record. I've gotten as far as being able to get the view button to work when I have just the subform, itself, open. However, when I have the main form open (which then means the subform is also open), and click the View button, I get a dialog box to enter a parameter. Of course, once entered, the form pops up with the correct record referenced. Any help would be a godsend! Thanks! (Oh...Access 2003/XPPro)
Jan 17 '07 #1
4 13398
MMcCarthy
14,534 Recognized Expert Moderator MVP
I am new at Access, databases, AND posting threads (sorry). I have a subform that is a continuous form based on a tabular query. I enter a particular serial # (on the main form) and the subform shows me one to several forms that are related to that serial #. Each form shows only a few select fields of that particular record. I would like to be able to click a Veiw button (which is a cmd button on this subform) to bring up yet another form that would show ALL of the fields of that ONE SAME record. I've gotten as far as being able to get the view button to work when I have just the subform, itself, open. However, when I have the main form open (which then means the subform is also open), and click the View button, I get a dialog box to enter a parameter. Of course, once entered, the form pops up with the correct record referenced. Any help would be a godsend! Thanks! (Oh...Access 2003/XPPro)
What code are you using behind the view button?
Jan 17 '07 #2
NeoPa
32,568 Recognized Expert Moderator MVP
Yes, This will be a query of some form I suspect. Can you post the SQL of the query too if you use a QueryDef (saved query) in your code.
From your post it sounds like your query is using a parameter of some form. We need to replace that with the selection from your form but need the details first to know exactly how to.
Jan 17 '07 #3
Leah Trahan
5 New Member
Thanks for your replies, but I figured it out in the meantime! All I had to do was to use the cmd button wizard! Geez! I had created the button, originally, thinking I would have to use some specially created macro, so I had skipped the wizard... It created the following event procedure:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdView_Click()
  2. On Error GoTo Err_cmdView_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "frmViewSerNum"
  8.  
  9.     stLinkCriteria = "[idsNCRNum]=" & Me![idsNCRNum]
  10.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  11.  
  12. Exit_cmdView_Click:
  13.     Exit Sub
  14.  
  15. Err_cmdView_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_cmdView_Click
  18.  
  19. End Sub
I'll be posting with some other problem soon, I'm sure! Thanks again!
Jan 17 '07 #4
NeoPa
32,568 Recognized Expert Moderator MVP
That's fine and thanks for replying.
It's actually better when the OP finds the solution themselves. It indicates learning and growth :)
Jan 17 '07 #5

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

Similar topics

1
5937
by: Crispywafers | last post by:
Hi all, This seems like it would be fairly simple, but quite frankly I can't figure it out. I have combed through other posts and still can't get it working. I have two tables (Students, Emergency Contacts) and two seperate main entry forms for each table (frmNewStudent & frmEmergencyContacts). I wanted to put a command button on frmNewStudent that when clicked would open up frmEmergencyContacts to an add new record so that a user
1
6413
by: simonmarkjones | last post by:
Hi there when i open a form in Access 2000 i would like to present the user with a new empty record (I dont want them to be able to view the first or any other records). I'm guessing i would put something in the On Open event perhaps. Not too sure. Many thanks in advance.
5
2619
by: John | last post by:
Hi If I have a form open, what is the code that is equivalent to using the File->Print menu with select record(s) option to print the form with the currently displayed record values? Thanks Regards
8
18220
by: anansi | last post by:
Hi I have a form called 'shiftviewer' and it contains a subform called 'all shifts for current month subform'. the subform is in datasheet view (access 2007) and the main form is a column orientated form. Both forms contain records of 'shifts' I want to be able to select a record (a shift) in the subform, and be able to set the parent form's current record to that record, through the identifying primary key that a shift record has...
4
32456
by: SDave | last post by:
I have read several responses to this problem around the web, but my programming knowledge wasn't strong enough to translate those responses to my problem. I have a database with one table, the primary key of this table is called ID Number (It is a number, not a string). There are two forms in the database, and I made a button to switch from one form to the other. When I am in Form1, I want to be able to click the button to go to Form2, while...
19
7802
WyvsEyeView
by: WyvsEyeView | last post by:
Okay, now I need to open a form (frmTopics) and select the same record that has been double-clicked on in a separate form (frmTopicsFound). Here are the details: frmTopicsFound contains datasheet subform sfrmTopicsFound. sfrmTopicsFound is populated from a query that returns a list of topics based on a keyword search. I want users to be able to double-click a row in sfrmTopicsFound and have frmTopics open to that same record. frmTopics may or...
6
65067
by: awojciehowski | last post by:
I am assuming this is an easy fix but I want to open a form from a switchboard button. I also want the form to automatically open to the last record of that form. Any ideas on how I can accomplish this? Thanks! Adam
8
31403
reginaldmerritt
by: reginaldmerritt | last post by:
Hi, I'm using the following code to open a form on a specific record. I have a form displaying records in a list which then allows users to click onto the record to open it up in a new form in a single view. DoCmd.OpenForm "FRMBookingDetails", , " = " & Me.BookingID The form opens only on the first record only and never the chosen record. Sometimes it opens the form on a new record.
6
3064
by: Adam Tippelt | last post by:
I've got a form that allows users to "save the current record to drafts" if they haven't finished writing all the data for that record. This saves it in it's current state, which puts it in a temporary table. The record is also tagged with the name of the user who created it. What I'm trying to do is to force the form to open up and load this record when the form is loaded/opened. The structure of the database only allows users to have one...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8893
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...
0
8797
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8583
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,...
1
6209
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
4205
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...
1
2791
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
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.