R
Rich
Hi,
Hopefully someone could assist me on this. I have a field that when
filled in with a value, opens another form using that value as link
criteria. When I trace the code in the Form_Open routine, it doesn't
have the linked field value (the record that was supposed to be opened),
but it starts at the first record.
How can I get it to open on the record (i.e. Bill#) that I have opened
it with the Link Criteria with?
Is this the way the on Open routine works (i.e. doesn't have a record in
memory the 1st time)?
i.e.
'from field, 'BILL' on form 'POSTAPAYMENT'
Private Sub Bill_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EnterPayments"
stLinkCriteria = "[BILL#]= " & Me![Bill]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "POSTAPAYMENT"
End Sub
'------------------------
'from form 'EnterPayments'
Private Sub Form_Open(CANCEL As Integer)
'Set frmResize = ADHResize2K.CreateFormResize()
'Set frmResize.Form = Me
'[BILL#].SetFocus
' DoCmd.FindRecord G_CurrentBill
If BillPaidChk = True Then
MsgBox "THIS BILL HAS ALREADY BEEN PAID"
Forms!EnterPayments.PostedDate
Forms!EnterPayments.AllowEdits = False
....'more code not pasted here ...
End Sub
'--------------------------
Thanks,
RJC
Hopefully someone could assist me on this. I have a field that when
filled in with a value, opens another form using that value as link
criteria. When I trace the code in the Form_Open routine, it doesn't
have the linked field value (the record that was supposed to be opened),
but it starts at the first record.
How can I get it to open on the record (i.e. Bill#) that I have opened
it with the Link Criteria with?
Is this the way the on Open routine works (i.e. doesn't have a record in
memory the 1st time)?
i.e.
'from field, 'BILL' on form 'POSTAPAYMENT'
Private Sub Bill_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EnterPayments"
stLinkCriteria = "[BILL#]= " & Me![Bill]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "POSTAPAYMENT"
End Sub
'------------------------
'from form 'EnterPayments'
Private Sub Form_Open(CANCEL As Integer)
'Set frmResize = ADHResize2K.CreateFormResize()
'Set frmResize.Form = Me
'[BILL#].SetFocus
' DoCmd.FindRecord G_CurrentBill
If BillPaidChk = True Then
MsgBox "THIS BILL HAS ALREADY BEEN PAID"
Forms!EnterPayments.PostedDate
Forms!EnterPayments.AllowEdits = False
....'more code not pasted here ...
End Sub
'--------------------------
Thanks,
RJC