Results 1 to 13 of 13

Thread: Open Form

  1. #1
    Join Date
    Apr 2004
    Posts
    182

    Unanswered: Open Form

    I have a form with two text boxes and a command button the command button opens another form depending on the entry in either of the text boxes - this works fine for one but I keep getting a Server Filter error on the other even though there is no server filter. What might I be doing wrong ?
    Last edited by livvie; 06-30-04 at 07:25.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try to open the second Form manually without code, and see whether you still have the error or not.

  3. #3
    Join Date
    Apr 2004
    Posts
    182
    second form opens ok. It's ok for one text box but not for the other but the linkcriteria is picking up the data and there is data to match it ?

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Does that mean you can open both forms manually without code? If yes, then you have an error in the VB programming you did..

  5. #5
    Join Date
    Apr 2004
    Posts
    182
    Major problem now. When I try to get at the code of this form I keep getting a Microsoft Error and Error Report request and the datatbase is shut down. It wont let me delete the form or an of the controls on it or rename or anything - how do I get rid of it ????? I cant access the code for any form at all because of it

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Just open a new DB file and copy all your objects (Tables, Queries, Forms, ...) to the new one. Try there to correct your VB code

    Good luck

  7. #7
    Join Date
    Apr 2004
    Posts
    182
    Just used a backup. This Microsoft thing keeps happening and is very annoying.
    Here is the code I am using that gives me the filter error.
    Private Sub cmdOpen_Click()
    On Error GoTo Err_cmdOpen_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "fsubFloorFix"

    stLinkCriteria = "[JOB_ID]=" & Me![txtjobid]
    DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

    Exit_cmdOpen_Click:
    Exit Sub

    Err_cmdOpen_Click:
    MsgBox Err.Description
    Resume Exit_cmdOpen_Click

    End Sub
    This works but if I change the field to [EMPLOYEE] and the text box to txtEmp I get the error - some of the other fields in my table work and others give the error too - what could teh difference be.

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Quote Originally Posted by livvie
    Just used a backup. This Microsoft thing keeps happening and is very annoying.
    Here is the code I am using that gives me the filter error.
    Private Sub cmdOpen_Click()
    On Error GoTo Err_cmdOpen_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "fsubFloorFix"

    stLinkCriteria = "[JOB_ID]=" & Me![txtjobid]
    DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

    Exit_cmdOpen_Click:
    Exit Sub

    Err_cmdOpen_Click:
    MsgBox Err.Description
    Resume Exit_cmdOpen_Click

    End Sub
    This works but if I change the field to [EMPLOYEE] and the text box to txtEmp I get the error - some of the other fields in my table work and others give the error too - what could teh difference be.

    I think this is because of the data Type
    The Job_ID is a numeric but the Employee is a String

  9. #9
    Join Date
    Apr 2004
    Posts
    182
    Makes sense the others that worked are numeric and those that didn't are strings - I'll see what I can do with that. Thanks a mil

  10. #10
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    So try to use the single cote '

  11. #11
    Join Date
    Apr 2004
    Posts
    182
    Where do I put it ?
    "[EMPLOYEE]=" & Me![txtemp]

  12. #12
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Quote Originally Posted by livvie
    Where do I put it ?
    "[EMPLOYEE]=" & Me![txtemp]
    "[EMPLOYEE]='" & Me![txtemp] &"'"

  13. #13
    Join Date
    Apr 2004
    Posts
    182
    Sorted - thanks again

Posting Permissions

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