hm, we.. requerying the main form when she clicks edit doesn't seem to do what i need. Maybe I'm not being very clear.
I have Form1, which is for browsing the data.
the Edit button is on this form with this code:
Code:
Private Sub cmdEdit_Click()
On Error GoTo Err_cmdEdit_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "BetterBidEntryForm"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdEdit_Click:
Exit Sub
Err_cmdEdit_Click:
MsgBox Err.Description
Resume Exit_cmdEdit_Click
End Sub
That opens the BetterBidEntry form, to the record she was viewing, so she can edit it. This works so far. On the BetterBidEntry form is a button that says "done". Here is the code for that button:
Code:
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
'prompt user to save changes
'check for changes
If Me.Dirty Then
'prompt user - if they don't want to save, don't save, and go to the switchboard
If MsgBox("Do you want to close without saving?", vbYesNo, "Close Form?") = vbYes Then
Me.Undo
DoCmd.Close , , acSaveNo
DoCmd.OpenForm "Switchboard"
Else
Exit Sub
End If
'If there are no changes made to the record, just go to the switchboard
Else
DoCmd.Close
DoCmd.OpenForm "Switchboard"
End If
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End Sub
So, this works, and of course sends her to the switchboard. But now what I want is to look at where she came from, and act on that information.
a) she comes from the switchboard, the form opens in add mode, and she adds her records, saves them, and clicks done, and goes back to the switchboard.
or
b) she came from clicking 'edit' on Form1, so when she's done editing the record, and clicks 'done', go back to browsing on Form1, to the same record she just edited, but show the changes.
clear as mud?
thanks y'all!