Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    23

    Unanswered: Open filtered form and edit

    I use the "Command Button Wizard" to open a form that applies filter in it...It works perfect but it never allows me to edit the fields in the filtered record. What shall I do so that I can edit with the fields?

    Pls help, Thx...

    Here is the code below:

    Private Sub cmdCustRecord_Click()
    On Error GoTo Err_cmdCustRecord_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "FCustEdit"

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

    Exit_cmdCustRecord_Click:
    Exit Sub

    Err_cmdCustRecord_Click:
    MsgBox Err.Description
    Resume Exit_cmdCustRecord_Click

    End Sub

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I don't see any reason why you would not be able to edit data into the form FCustEdit just because it's open with the code you posted. Is the data editable when you open the form manually from the database window?
    Have a nice day!

  3. #3
    Join Date
    Sep 2009
    Posts
    23
    Yes its editable in database window. In fact, if the FCustEdit is opened through switchboard,it can be edited...The problem only exist if I open FCustEdit from the other form and use a button to open and filter the CustName base on the CustName of the other form.
    It's something like,if I open it using the button,the locked of the text fields are enabled...

  4. #4
    Join Date
    Sep 2009
    Posts
    23
    Thnx for the help Sinndho.
    I forgot to update you, I got the reason why I can't edit the table. It's because I'm opening two forms and is accessing the same table. If two queries accessing the same table,you can only edit the records in the first open query; the records will be locked automatically if you opened the second query.

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Now that makes sense. Thanks for the feedback.
    Have a nice day!

Posting Permissions

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