Opening Form from Switchboard (1 Viewer)

B

BeccaJ

Guest
I have a form/subform that I am opening from a switchboard and I would like the main form to come up blank for creating a new record.

This may be a simple solution, but I can't seem to figure it out. Can anyone help? Thanks!
 

Peter Paul

Registered User.
Local time
Today, 00:43
Joined
Jan 1, 2000
Messages
82
There are two ways to do this easily. First, on the main form properties, under the DATA tab, you can select DATA ENTRY - YES. This will automatically bump you to a new screen when you open the form. However, you will not be able to access any of the previously entered data from that form. If you don't care about viewing all the records from this form, you are done.

Another way to do this, is to go into the EVENT tab for the properties of the button which opens your form. Click on the ... button next to ON CLICK and you will be in the SQL code for the button. It will look something like this:

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Supplemental Case Incident"
DoCmd.OpenForm stDocName, , , Resume Exit_Command3_Click

End Sub

Enter DoCmd.GoToRecord , , acNewRec after the DoCmd.OpenForm stDocName line, and close and save out to the form.

Now when you click on the button, it will open the form, and move you to a new record.

Hope it helps,
Peter Paul
 

Users who are viewing this thread

Top Bottom