Debbie,
I will assume that you have a form and will be selecting one of the records in the table using the form.
Now create a second form with the data from your table and in the format of interest.
Place a Command button on the first form and add this code to the Click Event.
---------------------
Private Sub cmdViewThisRecord_Click() 'Access will give your subroutine a name initially 'I have named this command ViewThisRecord
'Have an out in case the code throws an error On Error GoTo Err_cmdViewThisRecord_Click
'Declare a couple variables Dim stDocName As String Dim stLinkCriteria As String
'frmMySecondForm is the name that you give to the new form stDocName = "frmMySecondForm"
'MyName is the name of the field that links the two forms 'MyName can be the ID field (autonumber) or another field's name stLinkCriteria = "[MyName]=" & "'" & Me![MyName] & "'"
'Don't leave out any of the parentheses, single or double
'The next line opens the second form 'and displays the record with the same field name DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewThisRecord_Click: Exit Sub
'These lines trap errors Err_cmdViewThisRecord_Click: MsgBox Err.Description Resume Exit_cmdViewThisRecord_Click End Sub
-----The easiest way to do this however is to use the form wizard.
Open your first form Switch to Design View Draw a command button Select Form Operations Click Open Form Next select the second form in the list of available forms Next Click Open the form and find specific data to display Next Match a field in both the left and right panes by clicking them Click the <-> button Next Give the button a name or select an image Finish
Now when these actions don't work: It is when there is no match for the fields sourcing the two forms.
I hope this helps.
LDN
"Debbie" wrote:
[Quoted Text] > I have created a table of records. When a record is clicked, I want the > specific form for that record to open. The command I have now, Open Form, > opens a new, blank form. Any thoughts on how to get the specific form to > open. This is driving me crazy!!!! > -- > Debbie
|