S
Simon Cleal
Access 2000
Hi I'm trying to open a form using a command button - code as follows:
Private Sub cmd_lta_Click()
On Error GoTo Err_cmd_lta_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_bpd_lta"
stLinkCriteria = "[member]=" & Me![memberkey]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_lta_Click:
Exit Sub
Err_cmd_lta_Click:
MsgBox Err.Description, , Err.Number
Resume Exit_cmd_lta_Click
End
The form has the following code in it's open and load events:
Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.BOF = True And Me.Recordset.EOF = True Then
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.Member.DefaultValue = [Forms]![frm_bpd]![memberkey]
End If
End Sub
Private Sub Form_Load()
cmd_edit_save.Visible = False
cmd_edit_cancel.Visible = False
If PrtctnType.Value = "E" Then
Me.PrtctdLSAmount.Visible = False
Me.PrtctdLSPercent.Visible = True
Else
Me.PrtctdLSAmount.Visible = True
Me.PrtctdLSPercent.Visible = False
End If
End Sub
When click on the cmd button I get error 2501. This seems to be regardless
of whether the member has a record in the LTA table
Anyone able to help?
Thanks in advance
Simon
Hi I'm trying to open a form using a command button - code as follows:
Private Sub cmd_lta_Click()
On Error GoTo Err_cmd_lta_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_bpd_lta"
stLinkCriteria = "[member]=" & Me![memberkey]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_lta_Click:
Exit Sub
Err_cmd_lta_Click:
MsgBox Err.Description, , Err.Number
Resume Exit_cmd_lta_Click
End
The form has the following code in it's open and load events:
Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.BOF = True And Me.Recordset.EOF = True Then
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.Member.DefaultValue = [Forms]![frm_bpd]![memberkey]
End If
End Sub
Private Sub Form_Load()
cmd_edit_save.Visible = False
cmd_edit_cancel.Visible = False
If PrtctnType.Value = "E" Then
Me.PrtctdLSAmount.Visible = False
Me.PrtctdLSPercent.Visible = True
Else
Me.PrtctdLSAmount.Visible = True
Me.PrtctdLSPercent.Visible = False
End If
End Sub
When click on the cmd button I get error 2501. This seems to be regardless
of whether the member has a record in the LTA table
Anyone able to help?
Thanks in advance
Simon