L
Lori
Okay here's the issue. On one form I have two search fields set up one to
search by name and another to search by project number. After Update they
work beautifully to move the user to the correct project. the code for these
are as follows:
Private Sub cboProject_AfterUpdate()
DoCmd.GoToRecord
Me!JobName.SetFocus
DoCmd.FindRecord Me!cboProject
'Set value of combo box equal to an empty string
Me!cboProject.Value = ""
End Sub
Private Sub CboProjectNo_AfterUpdate()
DoCmd.GoToRecord
Me!Project.SetFocus
DoCmd.FindRecord Me!CboProjectNo
'Set value of combo box equal to an empty string
Me!CboProjectNo.Value = ""
End Sub
As I said these work beautifully however here is the problem. If a user
searches for a specific project (regardless of whether it is by name or
number) they can easily move to the next project UNLESS they make a change
and update the current record. If they update a record and then try to move
to the next record they receive an error stating that "You Can't Go to the
Specified Record." If an attempt is made to search for the next record, it
will search fine but it will not go to the new search item. The user gets a
Run Time Error that states "You Can't Go to the Specified Record" and it
gives them the option to debug.
How do we get around this? Is it essential that they close the form after
every search that requires an update?
search by name and another to search by project number. After Update they
work beautifully to move the user to the correct project. the code for these
are as follows:
Private Sub cboProject_AfterUpdate()
DoCmd.GoToRecord
Me!JobName.SetFocus
DoCmd.FindRecord Me!cboProject
'Set value of combo box equal to an empty string
Me!cboProject.Value = ""
End Sub
Private Sub CboProjectNo_AfterUpdate()
DoCmd.GoToRecord
Me!Project.SetFocus
DoCmd.FindRecord Me!CboProjectNo
'Set value of combo box equal to an empty string
Me!CboProjectNo.Value = ""
End Sub
As I said these work beautifully however here is the problem. If a user
searches for a specific project (regardless of whether it is by name or
number) they can easily move to the next project UNLESS they make a change
and update the current record. If they update a record and then try to move
to the next record they receive an error stating that "You Can't Go to the
Specified Record." If an attempt is made to search for the next record, it
will search fine but it will not go to the new search item. The user gets a
Run Time Error that states "You Can't Go to the Specified Record" and it
gives them the option to debug.
How do we get around this? Is it essential that they close the form after
every search that requires an update?