Access 2003 - Error 16389 "Reserved Error"

We've recently upgraded some from Win2k w/ Office 2000 to WinXP w/ Office 2003 and this error popped up.  I can't seem to figure out how to fix it.  I'll try to explain the best I can.

There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmentSubForm)

B_SingleQuartersAssignmentSubForm has a view as it's Record Source which looks something like this:

SELECT RankGrade, SurName, SQ_TransAutoNum, TrgActivityAutoNum, SvcNum, CF_Rank, RoomAssignment, RoomStartDate, RoomResEndDate, RoomMethodOfPayment, RoomResCounter, RoomResNotes, BldgNum + ' ' + RoomNum AS RoomAssignText, RecCreateByUserName, RecCreatePC_Name FROM A_BuildingsTbl

Although only SvcNum, CF_Rank, SurName, RoomStartDate, RoomResEndDate, RoomAssignText and RoomResNotes are displayed on the form.

So the user will choose the SvcNum (which auto populates the rank and last name), the start and end dates.  Then they press a little button to assign a room.  This button opens a new form where the user can choose the room to assign.  Once they choose the room they press the enter button which is supposed to update B_SingleQuartersAssignmentSubForm with the room assignment.  Here are the lines that are run when the user presses enter:

Forms![B_RationActivityMainForm].[SingleQuartersSubForm].Form![RoomAssignment] = Me.ListOfAvailableRooms
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form.Requery

What its supposed to do is assign the room id to RoomAssignment in the view (which is working fine) and then requery SingleQuartersSubForm so that RoomAssignText is displayed with the new info.  This is the line that is causing the error.

Here is a screen shot that may help give a better picture.
http://i12.photobucket.com/albums/a217/rshackleford/Error.jpg
bordentechAsked:
Who is Participating?
 
puppydogbuddyConnect With a Mentor Commented:
Glad you have an interim solution that enables you to move forward.
0
 
puppydogbuddyCommented:
I researched the public forums for this error, and the common link seems to be that the following command line does not work before a requery in an environment where Access 2003 is used as a front end, although it worked fine in Access 2000.

DoCmd.RunCommand acCmdSaveRecord

If you are using the above code line before a requery, try substituting the following code in its place and see if it helps.  As always, make sure you have your system backed up before making any changes.

If Me.Dirty Then
    Me.Dirty = False
End If

Hope this helps.
0
 
puppydogbuddyCommented:
ps:
see this link as an example of what appears on the public forums:
                  http://www.access-programmers.co.uk/forums/showthread.php?t=61865
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
bordentechAuthor Commented:
The DoCmd.RunCommand acCmdSaveRecord command is nowhere in the code.  I tried adding the Me.Dirty code in a few different places anyways with no luck.  I also tried the following just for the hell of it:

Forms![B_RationActivityMainForm].[SingleQuartersSubForm].Form![RoomAssignment] = Me.ListOfAvailableRooms
   
If Forms![B_RationActivityMainForm].[SingleQuartersSubForm].Form.Dirty Then
       Forms![B_RationActivityMainForm].[SingleQuartersSubForm].Form.Dirty = False
End If
   
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form.Requery

The funny thing is that the line:
Forms![B_RationActivityMainForm].[SingleQuartersSubForm].Form.Dirty = False
kicked the same 16389 error.
0
 
puppydogbuddyCommented:
That is odd!
Did you try the following:
1. comment out the requery line then test if you still get the error (knowing that the query output won't be correct....just a test to definitely pinpoint the requery line as the error line)
2. if the requery line is definitely the problem, then verify that [SingleQuartersSubForm] is the name of your subform control (i.e. the subform container).  Often the subform control and the source object (the form inside the container) have the same name, but sometimes they don't.
0
 
bordentechAuthor Commented:
ok I commented out the requery line and didn't get an error.  It's definetly the problem.  Also [SingleQuartersSubForm] is definetly the subform container.  You can see in this screen shot.

http://i12.photobucket.com/albums/a217/rshackleford/StupidError.jpg
0
 
puppydogbuddyCommented:
The Access 2003 compiler is more strict about using the correct operator, so this might be it:

Change the the dot {.} operator before >>> .[SingleQuartersSubForm] in the assignment statemement on the first line below to the bang operator >>> ![SingleQuartersSubForm] .  The requery line has the right operator..... maybe the assignment did not take place and the requery blew up.  To verify, place a code break immediately after the assignment statement but before the requery, and check if  the  assignment actually took place.

Forms![B_RationActivityMainForm]>>>>>>.[SingleQuartersSubForm]<<<<<<<.Form![RoomAssignment] = Me.ListOfAvailableRooms
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form.Requery

0
 
bordentechAuthor Commented:
I'd originally thought that was the problem, but when I close all the boxes after getting the error, the new data is still inserted into the table.  I retried again anyways with the following code and had the same error again.
 
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form![RoomAssignment] = Me.ListOfAvailableRooms
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form.Requery

It seems like I can't run the requery command on SingleQuartersSubForm from another form.  I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?  

Thanks for your help so far.
0
 
puppydogbuddyCommented:
I just noticed you also need to fix this >>>> Me.ListOfAvailableRooms
try changing it to:  Me!ListOfAvailableRooms
0
 
bordentechAuthor Commented:
Same error again.  :(
0
 
puppydogbuddyCommented:
1. Try doing a refresh before doing the requery and see what happens.
2.<<<<<It seems like I can't run the requery command on SingleQuartersSubForm from another form.  I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?>>>
You can directly call a procedure from another procedure.  Leave the parentheses off when you make the call:
Private Sub Form_Current()
YourCombobox_AfterUpdate
End Sub
0
 
bordentechAuthor Commented:
ok I tried both

Forms!B_RationActivityMainForm.Form.Refresh
and
Forms!B_RationActivityMainForm!SingleQuartersSubForm.Form.Refresh

I received the 16389 on both.
0
 
puppydogbuddyCommented:
See this link:  http://www.mvps.org/access/forms/frm0031.htm
according to the link, if you are refering to a control on subform1 from subform1, the syntax should be:
Me!ControlName.Requery

<<<There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmentSubForm)>>>>>
0
 
puppydogbuddyCommented:
p.s.
by Me!controlname.Requery...I mean:

Me!SingleQuartersSubForm.Requery
0
 
bordentechAuthor Commented:
I have no idea what's causing the problem here.  In my error handling I added this code:

Case 16389
Forms!b_rationactivitymainform!SingleQuartersSubForm.Form.Requery
Resume Next

It's working fine now from the users perspective.  I'm sick of working on this so I'm going to leave it at that for the time being.
0
All Courses

From novice to tech pro — start learning today.