Server Filter Problem

G

Guest

Hello:

This question concerns an Access 2003 Data Project.

I have a list box on a form that my end user is going to use to navigate to
a selected employees record. The end user selects a name from the list and
clicks on a button to navigate to that employee's detail form> Here is the
code I am using:

Private Sub cmdOpenEmployee_Click()
On Error GoTo Err_cmdOpenEmployee_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEmployees"

stLinkCriteria = "[UserID]=" & Me![lstEmployees]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenEmployee_Click:
Exit Sub

Err_cmdOpenEmployee_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEmployee_Click

End Sub

My problem is that whatever employee I first navigate to when the
application is opened, I always get the same employee even though I have gone
back to the list and selected another employee. I have made sure I closed
the search form before opening the detail form. When I open the properties of
the Employee record, it looks as if the entry in the Server Filter box is
somehow getting "stuck".

I have tried a form refresh event when opening the detail record but that
doesn't work. The only way I can get it to work is to close the application
entirely and reopen and select the employee.

Any ideas would be appreciated.

Brennan
 
G

Guest

Brennan,

I have had the exact same problem happen to me recently. In my case I have
buttons that open another form. It is very peculiar because I have other
forms that used this same code and I have not had a problem with them until I
reviewed them to make sure my other code was the same. Now, both of the sets
of forms are doing the exact same thing (Not pulling up the right
information). It seems that something has happened in the last 2-4 weeks to
access. I also found that if I removed the server filter information under
the form properties the form would fix it. I tried clearing the server
filter problem upon closing my suborm. This was ineffective. I am trying
something else right now and am not sure that it is a permanent fix or not.
Before I would hide the id number on the subform so users could not see it.
In my testing I made it visible so I could see the id number. For some
reason if my id number is visible the forms work correctly. So I decrease
the size of the text box so the users can't make it out. Once again I am not
sure if this is a permanent fix, but it works for a little while.

I am developing a new package right now and am having second thoughts of
using access.

I use windows xp pro sp1 with access 2003. This is project that uses a sql
server 2000 box. This problem extends to the runtime version of access.
 
G

Guest

It just got even weirder for me. When I was moving off the form with the
search criteria, I was closing it. After the user works with the employee
record they have selected, they can click on a button to navigate to the main
HR menu. I have found that if I leave the serach for open, the code works
and I can go back repeatedly and pick different employees and have their info
appear when I go to the detail form.

I'm also noticing that the same code that works on one form doesn't work on
another form.

For example, I am using Docmd.Close to close forms as I navigate to other
ones. (This is a switchboard I am building) I'm just using the button wizard
to create an open form command and then I go in and add the DoCmd.Close code
to the vba. I have abolutely no idea why it works on some forms and not on
others nut it is frustrating.

Thanks

Mark said:
Brennan,

I have had the exact same problem happen to me recently. In my case I have
buttons that open another form. It is very peculiar because I have other
forms that used this same code and I have not had a problem with them until I
reviewed them to make sure my other code was the same. Now, both of the sets
of forms are doing the exact same thing (Not pulling up the right
information). It seems that something has happened in the last 2-4 weeks to
access. I also found that if I removed the server filter information under
the form properties the form would fix it. I tried clearing the server
filter problem upon closing my suborm. This was ineffective. I am trying
something else right now and am not sure that it is a permanent fix or not.
Before I would hide the id number on the subform so users could not see it.
In my testing I made it visible so I could see the id number. For some
reason if my id number is visible the forms work correctly. So I decrease
the size of the text box so the users can't make it out. Once again I am not
sure if this is a permanent fix, but it works for a little while.

I am developing a new package right now and am having second thoughts of
using access.

I use windows xp pro sp1 with access 2003. This is project that uses a sql
server 2000 box. This problem extends to the runtime version of access.

Brennan said:
Hello:

This question concerns an Access 2003 Data Project.

I have a list box on a form that my end user is going to use to navigate to
a selected employees record. The end user selects a name from the list and
clicks on a button to navigate to that employee's detail form> Here is the
code I am using:

Private Sub cmdOpenEmployee_Click()
On Error GoTo Err_cmdOpenEmployee_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEmployees"

stLinkCriteria = "[UserID]=" & Me![lstEmployees]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenEmployee_Click:
Exit Sub

Err_cmdOpenEmployee_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEmployee_Click

End Sub

My problem is that whatever employee I first navigate to when the
application is opened, I always get the same employee even though I have gone
back to the list and selected another employee. I have made sure I closed
the search form before opening the detail form. When I open the properties of
the Employee record, it looks as if the entry in the Server Filter box is
somehow getting "stuck".

I have tried a form refresh event when opening the detail record but that
doesn't work. The only way I can get it to work is to close the application
entirely and reopen and select the employee.

Any ideas would be appreciated.

Brennan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top