Hi All,
I need some help if anyone has a moment! I have a form that when opened I want to view all past entries. I have a button on the form to allow me to add a new entry.
The problem is that when I open the form it automatically goes to a new entry and I don't know why. This is the coding I am using on the button to open the new form.
------------------------------
Private Sub Invoice_Click()
On Error GoTo Err_Invoice_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim GymnastID As Long
stDocName = "frmInvoice"
GymnastID = Me!GymnastID
stLinkCriteria = "[GymnastID]=" & Me![GymnastID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms(stDocName)![GymnastID] = GymnastID
Exit_Invoice_Click:
Exit Sub
Err_Invoice_Click:
MsgBox Err.Description
Resume Exit_Invoice_Click
End Sub
------------------------------
Cheers - Scott.
I need some help if anyone has a moment! I have a form that when opened I want to view all past entries. I have a button on the form to allow me to add a new entry.
The problem is that when I open the form it automatically goes to a new entry and I don't know why. This is the coding I am using on the button to open the new form.
------------------------------
Private Sub Invoice_Click()
On Error GoTo Err_Invoice_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim GymnastID As Long
stDocName = "frmInvoice"
GymnastID = Me!GymnastID
stLinkCriteria = "[GymnastID]=" & Me![GymnastID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms(stDocName)![GymnastID] = GymnastID
Exit_Invoice_Click:
Exit Sub
Err_Invoice_Click:
MsgBox Err.Description
Resume Exit_Invoice_Click
End Sub
------------------------------
Cheers - Scott.