hi there,
I am needing some help with a database I am putting together. The database
works off of a main Form, which then has buttons on it that will open up
other forms. The problem I am having is that if I am updating any
information on the current record, and then open one of the other forms, the
new form will not show the updated information. I realize that a simple
macro solves this problem by basically closing the first form, opening the
new form, and then on exiting the new form opening the first one again. The
problem is, that with one of the sub forms that I need to open requires some
vb script with it. Here is the script:
Private Sub INDIVIDUALSLIP_ Click()
On Error GoTo Err_INDIVIDUALS LIP_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIndividualS lip"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , SlipID.Value
Exit_INDIVIDUAL SLIP_Click:
Exit Sub
Err_INDIVIDUALS LIP_Click:
MsgBox Err.Description
Resume Exit_INDIVIDUAL SLIP_Click
End Sub
Now, I have tried playing around with the DoCmd.Close but I just cannot seem
to get it to work. It always ends up telling me that I am refering to
something that doesn't exist or is already closed. So the help that I am
seeking is basically being able to have the script not only do what it is
currently doing, but also close the form so that the changes show when the
new forms opens up. However, I think I just had one of those "eureka"
moments. I think I see what my problem is...hehe...The main form has
specific ID values attached to each record, and when the "frmIndividualS lip"
is being called to open up, it is grabbing the ID value from the main form
(which is still open) so that it will retrieve the record that is being
looked at in the main form. Which is what I need it to do. So, now that I
realize the obstacle that I am faced with, is there any way around it? Am I
able to have the record that has been updated in the main form, still
populate itself in the new form that is being called to open, and still
contain the updated values?
I also realize that this problem can be solved by just going forward one
record, and then coming back to the record that was updated, and then
calling the new form to open it, thus showing the new values. And this is
what I have been doing, the only problem is that I know once I ask people to
use this database they may forget from time to time to do the whole "forward
then back".
I really appreciate any help that can be offered.
Thank You
I am needing some help with a database I am putting together. The database
works off of a main Form, which then has buttons on it that will open up
other forms. The problem I am having is that if I am updating any
information on the current record, and then open one of the other forms, the
new form will not show the updated information. I realize that a simple
macro solves this problem by basically closing the first form, opening the
new form, and then on exiting the new form opening the first one again. The
problem is, that with one of the sub forms that I need to open requires some
vb script with it. Here is the script:
Private Sub INDIVIDUALSLIP_ Click()
On Error GoTo Err_INDIVIDUALS LIP_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIndividualS lip"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , SlipID.Value
Exit_INDIVIDUAL SLIP_Click:
Exit Sub
Err_INDIVIDUALS LIP_Click:
MsgBox Err.Description
Resume Exit_INDIVIDUAL SLIP_Click
End Sub
Now, I have tried playing around with the DoCmd.Close but I just cannot seem
to get it to work. It always ends up telling me that I am refering to
something that doesn't exist or is already closed. So the help that I am
seeking is basically being able to have the script not only do what it is
currently doing, but also close the form so that the changes show when the
new forms opens up. However, I think I just had one of those "eureka"
moments. I think I see what my problem is...hehe...The main form has
specific ID values attached to each record, and when the "frmIndividualS lip"
is being called to open up, it is grabbing the ID value from the main form
(which is still open) so that it will retrieve the record that is being
looked at in the main form. Which is what I need it to do. So, now that I
realize the obstacle that I am faced with, is there any way around it? Am I
able to have the record that has been updated in the main form, still
populate itself in the new form that is being called to open, and still
contain the updated values?
I also realize that this problem can be solved by just going forward one
record, and then coming back to the record that was updated, and then
calling the new form to open it, thus showing the new values. And this is
what I have been doing, the only problem is that I know once I ask people to
use this database they may forget from time to time to do the whole "forward
then back".
I really appreciate any help that can be offered.
Thank You
Comment