473,379 Members | 1,245 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,379 software developers and data experts.

Open form that shows current record

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 13373
MMcCarthy
14,534 Expert Mod 8TB
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,556 Expert Mod 16PB
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
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,556 Expert Mod 16PB
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
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,...
1
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...
5
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 ...
8
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...
4
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...
19
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...
6
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...
8
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...
6
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.