Button To Open Table

ChrisF

New member
Local time
Today, 07:41
Joined
Jun 12, 2003
Messages
8
This could just be me being blind as a bat, but how or can you create a button in a form to open a table?

The only way i can open a table atm from a form is Via a Hyperlink!

Pls Help!! :confused:
 
Create a New Form based on your table and in the forms properties set the default view to Datasheet. In the OnClick event of your button put...
Code:
Private Sub YourButton_Click()
On Error GoTo Err_YourButton_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "NameOfYourForm"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_YourButton_Click:
    Exit Sub

Err_YourButton_Click:
    MsgBox Err.Description
    Resume Exit_YourButton_Click
    
End Sub
changing "YourButton" to the Name of your button and "NameOfYourForm" to the Name of your new Form.

IMO
 
ChrisF said:
how or can you create a button in a form to open a table?

Why would you want to open a table from a form?
 

Users who are viewing this thread

Back
Top Bottom