Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New To Access Need Help

Status
Not open for further replies.

squash213

Technical User
Sep 18, 2001
2
US
Okay I don't know if this possible but as stated I'm new to this database building (I'm learning slowly on my own). I'd like to make two different tabs on a form. The first one has a sub form on it which I input info into. Now I want the second tab to be a report that has the same info from the first tab and it to show only that single record. I'm guessing I'd have to make the report a subform as well but I can't get it to work. I've tried many ways to do this and searched everywhere for help. Any help at all even a single step would be appreciated thanks.
 
If it's only one record, do you really need a report? What's wrong with a subform formatted as you want? You can look at it, print it. A report to me is something that presents lots of info with breaks, subtotals, handling new pages etc etc.

You can do a report easily enough but a related subform is a built-in feature of Access so why work at something if Mr Gates is willing to do all the work for free? mike.stephens@bnpparibas.com
 
Why not just add a button to your form to open the report? You could use one of the advanced wizards to open the report based on information in your form. You will need the advanced wizards installed and to make sure the wizard wand is depressed on the control toolbar (Access 97 but probably the same in later versions, yep I'm still in the dark ages).
 
Thanks for the help guys. I would like to be able to just click the tab and see the report without having to open another window, so I don't want to go with the button idea. But I think I'll try just the subfrom approach. I had thought of that too but I thought it would be easier (printing and eiditing wise) just to make a report then import it into a subform. How do I go about making them "related" so I see the same record on both. I had tried it before but it showed different records, I have a "find" box on the first tab if it makes a difference.
 
Am, squash213, what do you mean by,"...without having to open another window..."
If you do use two separate objects, you could have macros using the "SelectObject" action, to show either the Form or Report objects, depending on how you activate the macros. ie. from a button.

FYI:
I'm learning myself, so take my advice with pinch of salt.
 
The general use of a form is to provide a template for data entry and, conversely, display of a single record. So it would appear axiomatic that the use of a single form is really what you want to do. Reports are generally used to display multiple records or to sum data from more than one record.

If you want to display data in a format different from entry then use the same data fields on two tabs, but arranged differently.

However, if you're entering data in datasheet view you might consider not using a tab control at all, but using a single form and switch between the datasheet view and the form view. This gives you the ability to scroll through records and then view or edit the detail of any individual record.

To use this approach install a subform on your form and put a button named "Switch View" on your form (Not the subform). Place the following code in the "On Click" event of the button:

Private Sub comSwitchView_Click()
On Error Resume Next
Me![Name of your Subform].SetFocus
DoCmd.RunMacro "Switchview"
End Sub

Create a macro called "SwitchView" and set the action to RunCommand and the command to SubformDatasheet.

This permits toggling between datasheet and form view.

Hope this gives you some ideas.

Uncle Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top