Javelin
The Backpacker
- Local time
- Today, 14:20
- Joined
- Mar 14, 2003
- Messages
- 12
Can someone please help?
I have a database where the users can view all the records, via a form, in read-only format. Should the user wish to change any details at all on a particular record - they are forced to complete an audit trail first.
All this simply means is that at the bottom of each record (form) there is a link to the audit trail - this link was created using the command wizard to select the specific record. This is the code that is produces;
Private Sub Command51_Click()
On Error GoTo Err_Command51_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Amend Risk"
stLinkCriteria = "[Risk No]=" & "'" & Me![Ref No] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click
End Sub
My problem is that I want the form the user is leaving (i.e. the read-only record form) to close once the command link is activated to open the audit form. What code do I need to enter?
Also; when I open the audit form it still retains the information from the last person to complete the form - How can I/ or what code do I need to make sure the form opens with all the fields blank?
Thanks
Jav
I have a database where the users can view all the records, via a form, in read-only format. Should the user wish to change any details at all on a particular record - they are forced to complete an audit trail first.
All this simply means is that at the bottom of each record (form) there is a link to the audit trail - this link was created using the command wizard to select the specific record. This is the code that is produces;
Private Sub Command51_Click()
On Error GoTo Err_Command51_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Amend Risk"
stLinkCriteria = "[Risk No]=" & "'" & Me![Ref No] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click
End Sub
My problem is that I want the form the user is leaving (i.e. the read-only record form) to close once the command link is activated to open the audit form. What code do I need to enter?
Also; when I open the audit form it still retains the information from the last person to complete the form - How can I/ or what code do I need to make sure the form opens with all the fields blank?
Thanks
Jav