Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set Link Criteria Problem (MS Access 2000)

    I was wondering if someone could help me with this. The code below opens up a continuous form, identical to the previous one except that certain fields are not locked for editing (we call this Admin Edit Mode). Only certain people in the group have Admin rights.

    I have now implemented a new feature on the "regular" form that enables you to search for multiple records through the one parameter value box (searching on the "RefNo" field). So now the regular form may contain multiple records with different "RefNo" fields. The consequence of this is that if you click the Admin Edit Mode button, only the record in the regular form that has the current focus will open in the Admin screen because (I think) the Link Criteria is set to "RefNo", which may be different for each record on the continuous regular form.

    How can I set the link criteria to open the Admin form to display all of the records from the regular form?
    =========================================
    Private Sub AdminEditMode_Click()
    On Error GoTo Err_AdminEditMode_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frm_Coordination_Edit"

    stLinkCriteria = "[RefNo]=" & "'" & Me![RefNo] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_AdminEditMode_Click:
    Exit Sub

    Err_AdminEditMode_Click:
    MsgBox "I'm sorry. You do not have permission to enter Admin Edit Mode."
    Resume Exit_AdminEditMode_Click

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Set Link Criteria Problem (MS Access 2000)

    How is the "search" feature implemented? Does it filter the regular form? If so, you can do something like this:

    Private Sub AdminEditMode_Click()
    Dim stDocName As String
    On Error GoTo Err_AdminEditMode_Click
    stDocName = "frm_Coordination_Edit"
    DoCmd.OpenForm stDocName
    If Me.FilterOn = True Then
    Forms(stDocName).Filter = Me.Filter
    Forms(stDocName).FilterOn = True
    End If

    Exit_AdminEditMode_Click:
    Exit Sub

    Err_AdminEditMode_Click:
    MsgBox "I'm sorry. You do not have permission to enter Admin Edit Mode."
    Resume Exit_AdminEditMode_Click
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •