Form no longer working in Access 2007

J

Jadiva

Help! I have a database that was created in Access 2002. My company recently
switched to Access 2007 and now one of the forms is no longer working and I
can't seem to figure out why. The form is used to lookup employee information
and allows the user to make edits. There is a combo box (named: "AcidFind")
that displays a list of employees showing their acid (employee id) and their
name. I'm suppose to be able to select an employee from the combo box and the
form should automatically populate the "Acid" field, pull the employee record
from the employee table, and display it on the form. I've provided the
"After_Update" code used on the combo box "AcidFind" below:

Private Sub AcidFind_AfterUpdate()
DoCmd.ApplyFilter "", "[olbemployee]![Acid] =
[Forms]![olbemployee]![AcidFind]"
Forms!OLBEmployee!AcidFind = ""
End Sub

This worked fine in Access 2002. Maybe it's just a setting I have to change
but I haven't been able to get anything to work so far. Please help if you
can..

Thanks,

Jadiva
 
A

Allen Browne

Access 2007 forms have a new property called FilterOnLoad.

Try setting this property to No. Otherwise a previous filter may be applied,
so the records you expect in the form are not loaded.
 
J

Jadiva

Thanks. I changed the "FilterOnLoad" property to "No" and saved and reopened
the Form. I was able to click on someone in the combo box and the form
populated with the person's information. But it only worked one time. I'm
suppose to be able to continue using the combo box to select another person
without closing and reopening the form. Any Ideas?

Thanks,

Jadiva

Allen Browne said:
Access 2007 forms have a new property called FilterOnLoad.

Try setting this property to No. Otherwise a previous filter may be applied,
so the records you expect in the form are not loaded.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jadiva said:
Help! I have a database that was created in Access 2002. My company
recently
switched to Access 2007 and now one of the forms is no longer working and
I
can't seem to figure out why. The form is used to lookup employee
information
and allows the user to make edits. There is a combo box (named:
"AcidFind")
that displays a list of employees showing their acid (employee id) and
their
name. I'm suppose to be able to select an employee from the combo box and
the
form should automatically populate the "Acid" field, pull the employee
record
from the employee table, and display it on the form. I've provided the
"After_Update" code used on the combo box "AcidFind" below:

Private Sub AcidFind_AfterUpdate()
DoCmd.ApplyFilter "", "[olbemployee]![Acid] =
[Forms]![olbemployee]![AcidFind]"
Forms!OLBEmployee!AcidFind = ""
End Sub

This worked fine in Access 2002. Maybe it's just a setting I have to
change
but I haven't been able to get anything to work so far. Please help if you
can..

Thanks,

Jadiva
 
A

Allen Browne

This will depend on how the combo works.

Perhaps the form's RecordSource is a query that reads a value from the
combo, e.g. criteria such as:
[Forms].[Form1].[Combo0]

If so, remove the criteria from the query, and use code in the AfterUpdate
event of the combo to go to the correct record (if there's only one), or to
filter the form (if there could be multiple matches.

Here's an example of the former:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jadiva said:
Thanks. I changed the "FilterOnLoad" property to "No" and saved and
reopened
the Form. I was able to click on someone in the combo box and the form
populated with the person's information. But it only worked one time. I'm
suppose to be able to continue using the combo box to select another
person
without closing and reopening the form. Any Ideas?

Thanks,

Jadiva

Allen Browne said:
Access 2007 forms have a new property called FilterOnLoad.

Try setting this property to No. Otherwise a previous filter may be
applied,
so the records you expect in the form are not loaded.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jadiva said:
Help! I have a database that was created in Access 2002. My company
recently
switched to Access 2007 and now one of the forms is no longer working
and
I
can't seem to figure out why. The form is used to lookup employee
information
and allows the user to make edits. There is a combo box (named:
"AcidFind")
that displays a list of employees showing their acid (employee id) and
their
name. I'm suppose to be able to select an employee from the combo box
and
the
form should automatically populate the "Acid" field, pull the employee
record
from the employee table, and display it on the form. I've provided the
"After_Update" code used on the combo box "AcidFind" below:

Private Sub AcidFind_AfterUpdate()
DoCmd.ApplyFilter "", "[olbemployee]![Acid] =
[Forms]![olbemployee]![AcidFind]"
Forms!OLBEmployee!AcidFind = ""
End Sub

This worked fine in Access 2002. Maybe it's just a setting I have to
change
but I haven't been able to get anything to work so far. Please help if
you
can..

Thanks,

Jadiva
 
J

Jadiva

After doing some research and playing around, I was able to find code in
another database that performed the same function but was working in Access
2007. I replaced the "AfterUpdate" code with the new code (provided below)
and it worked like a charm. Thanks for the help. I feel so relieved now.

Here's the code I used:

Private Sub AcidFind_AfterUpdate( )
DoCmd.ApplyFilter , "Acid=" & " ' " & Me!AcidFind.Value & " ' "
Me!AcidFind= ""
DoCmd.RunCommand acCmdRefresh
End Sub

Allen Browne said:
This will depend on how the combo works.

Perhaps the form's RecordSource is a query that reads a value from the
combo, e.g. criteria such as:
[Forms].[Form1].[Combo0]

If so, remove the criteria from the query, and use code in the AfterUpdate
event of the combo to go to the correct record (if there's only one), or to
filter the form (if there could be multiple matches.

Here's an example of the former:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jadiva said:
Thanks. I changed the "FilterOnLoad" property to "No" and saved and
reopened
the Form. I was able to click on someone in the combo box and the form
populated with the person's information. But it only worked one time. I'm
suppose to be able to continue using the combo box to select another
person
without closing and reopening the form. Any Ideas?

Thanks,

Jadiva

Allen Browne said:
Access 2007 forms have a new property called FilterOnLoad.

Try setting this property to No. Otherwise a previous filter may be
applied,
so the records you expect in the form are not loaded.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Help! I have a database that was created in Access 2002. My company
recently
switched to Access 2007 and now one of the forms is no longer working
and
I
can't seem to figure out why. The form is used to lookup employee
information
and allows the user to make edits. There is a combo box (named:
"AcidFind")
that displays a list of employees showing their acid (employee id) and
their
name. I'm suppose to be able to select an employee from the combo box
and
the
form should automatically populate the "Acid" field, pull the employee
record
from the employee table, and display it on the form. I've provided the
"After_Update" code used on the combo box "AcidFind" below:

Private Sub AcidFind_AfterUpdate()
DoCmd.ApplyFilter "", "[olbemployee]![Acid] =
[Forms]![olbemployee]![AcidFind]"
Forms!OLBEmployee!AcidFind = ""
End Sub

This worked fine in Access 2002. Maybe it's just a setting I have to
change
but I haven't been able to get anything to work so far. Please help if
you
can..

Thanks,

Jadiva
 

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

Top